一个集成Consul Template的Filebeat Docker容器,用于通过Consul动态生成Filebeat配置文件,实现灵活的日志收集与配置管理。该镜像结合Filebeat的日志收集能力与Consul Template的动态配置生成功能,适用于需要根据Consul Key-Value存储动态调整日志收集规则的环境。
5.2-0.18.0、latest - Filebeat v5.2 与 Consul Template v0.18.0 (https://github.com/stakater/dockerfile-filebeat-with-consul-template/blob/master/5.2/Dockerfile)1.2-0.18.0 - Filebeat v1.2 与 Consul Template v0.18.0 (https://github.com/stakater/dockerfile-filebeat-with-consul-template/blob/master/1.2/Dockerfile)bashdocker run stakater/filebeat-with-consul-template
挂载本地模板目录到容器的/templates目录:
bashdocker run -d -v $(PWD)/templates:/templates stakater/filebeat-with-consul-template
Consul Template守护进程查询Consul实例,更新指定的模板文件,并在更新完成后可选执行命令。默认执行以下命令:
bashconsul-template -consul-addr=$CONSUL_URL -template="/templates/filebeat.ctmpl:/etc/filebeat/filebeat.yml:/usr/bin/filebeat -c /etc/filebeat/filebeat.yml"
其中,CONSUL_URL环境变量需指定Consul实例地址(格式:host:port)。
镜像提供了示例模板(位于templates目录),使用前需满足以下前置条件:
Consul Key-Value条目
/var/log/app/*.log读取日志(/var/log/app为容器内映射目录)。若日志位于子目录或不同路径,可通过Consul Key-Value条目/filebeat/logsPath定义路径。示例:/var/log/app/*/*.log

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务