
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
A simple forwarder to send beats everywhere through udp, tcp, syslog and third-party
shLOGMATIC_KEY=<YOUR_LOGMATIC_KEY> docker run -dt \ -p 5044:5044 \ -e BFWD_OUTPUT_TYPE=logmatic \ -e BFWD_LOGMATIC_API_KEY=$LOGMATIC_KEY \ --name beats-forwarder \ logmatic/beats-forwarder
Notice that we've released a docker version: get the docker https://hub.docker.com/r/logmatic/beats-forwarder/ image Download the last version of the beats-forwarder (https://github.com/logmatic/beats-forwarder/releases)
sh# linux 64 mkdir -p beats-forwarder/etc && cd beats-forwarder curl -OL https://github.com/logmatic/beats-forwarder/releases/download/v0.1-rc1/beats-forwarder cd etc && curl -OL https://raw.githubusercontent.com/logmatic/beats-forwarder/dev/etc/config.yml cd .. chmod +x beats-forwarder # windows # download the lastest version and go to the installation directory mkdir etc/ # add the https://raw.githubusercontent.com/logmatic/beats-forwarder/dev/etc/config.yml file into the etc/dir ./beats-forwarder -c <your_config>
Beats-forwarder use a Yaml file as configuration. By default, beats-forwarder listens on all interfaces of the server and use 5044 as port. Beats are forwarder to the local syslog. Beats-forwarder allows you to ship them to:
The default configuration can be found here: config.yaml
Create a new file, beats-fwdr.yaml and set these attributes at least (it's a
recommendation not a mandatory):
yaml#### #### beats-forwarder default configuration #### input: # The port to listen on port: 5044 output: # The wanted output (syslog|udp_tcp|logmatic), by default syslog type: syslog # Syslog specific settings syslog: # Tag or application reported for each log tag: beats-fowarder-demo # Logmatic specific settings logmatic: # The Logmatic API Key for authentification key: "<YOUR_API_KEY>"
If you want to send beats directly to Logmatic.io, just set output.type to logmatic and
add copy/paste your Logmatic APY Key to output.type.logmatic.key.
Here we are!
./beats-forwarder -c beats-fwdr.yaml
Now, just configure your already existing beats to send them to the forwarder.
All you need to do is to add and configure the logstash output for each beat.
Edit metricbeat-config.yml and add at the end the following code:
yamloutput: logstash: # Set the beats-forwarder address hosts: [ "localhost:5044"] # The rest of the output configuration goes here ...
Restart the beat, and check the incomming beats. If you have followed this tutorial, beats are sent to the local syslog.
sh# this can be different depending on your OS journalctl -f
And the magic goes on:
... Oct 06 15:33:56 jarvis beats-by-gpolaert[6417]: {"@metadata":{"beat":"topbeat","type":"filesystem"},"@timestamp":"2016-10-06T13:33:55.108Z","beat":{"hostname":"jarvis","name":"jarvis"},"count":1,"fs":{"avail":0,"device_name":"cgroup","files":0,"free":0,"free_files":0,"mount_point":"/sys/fs/cgroup/freezer","total":0,"used":0,"used_p":0},"type":"filesystem"} Oct 06 15:33:56 jarvis beats-by-gpolaert[6417]: {"@metadata":{"beat":"topbeat","type":"filesystem"},"@timestamp":"2016-10-06T13:33:55.108Z","beat":{"hostname":"jarvis","name":"jarvis"},"count":1,"fs":{"avail":0,"device_name":"cgroup","files":0,"free":0,"free_files":0,"mount_point":"/sys/fs/cgroup/pids","total":0,"used":0,"used_p":0},"type":"filesystem"} Oct 06 15:33:56 jarvis beats-by-gpolaert[6417]: {"@metadata":{"beat":"topbeat","type":"filesystem"},"@timestamp":"2016-10-06T13:33:55.108Z","beat":{"hostname":"jarvis","name":"jarvis"},"count":1,"fs":{"avail":0,"device_name":"mqueue","files":0,"free":0,"free_files":0,"mount_point":"/dev/mqueue","total":0,"used":0,"used_p":0},"type":"filesystem"} Oct 06 15:33:56 jarvis beats-by-gpolaert[6417]: {"@metadata":{"beat":"topbeat","type":"filesystem"},"@timestamp":"2016-10-06T13:33:55.108Z","beat":{"hostname":"jarvis","name":"jarvis"},"count":1,"fs":{"avail":0,"device_name":"configfs","files":0,"free":0,"free_files":0,"mount_point":"/sys/kernel/config","total":0,"used":0,"used_p":0},"type":"filesystem"}
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务