使用fluentd监控docker日志时加入容器id
2017-02-15 15:38
1096 查看
td-agent.conf配置文件内容如下:
1.tag_parts[]数组中的内容就是filter之后的标记以点分隔
2.
*可以作为一个占位符扩展到实际的文件路径,用’.’代替’/’。比如:
相当于
<source> type tail read_from_head true path /var/lib/docker/containers/*/*-json.log pos_file /var/log/fluentd-docker.pos time_format %Y-%m-%dT%H:%M:%S tag docker.* format json </source> # Using filter to add container IDs to each event <filter docker.var.lib.docker.containers.*.*.log> type record_transformer <record> container_id ${tag_parts[5]} </record> </filter> <match docker.var.lib.docker.containers.*.*.log> type elasticsearch logstash_format true host "#{ENV['ES_PORT_9200_TCP_ADDR']}" # dynamically configured to use Docker's link feature port 9200 flush_interval 5s </match>
1.tag_parts[]数组中的内容就是filter之后的标记以点分隔
2.
<source>中的
tag docker.*中的 *指:
*可以作为一个占位符扩展到实际的文件路径,用’.’代替’/’。比如:
path /path/to/file tag foo.*
相当于
path /path/to/file foo.path.to.file
相关文章推荐
- 使用 Elasticsearch 和 cAdvisor 监控 Docker 容器
- 使用fluentd管理docker日志
- 拾遗:使用 systemd-journald 管理 Docker 容器日志
- 如何使用数据卷在宿主机和docker容器之间共享文件
- 使用MDC为Logback slf4 日志记录线程ID,区分每次执行的会话日志
- linux下日志监控分析工具webalizer的安装及使用
- linux下日志监控分析工具awstat的安装与使用
- Flex4 中使用ModuleLoader为子容器 动态加入到TabNavigator导航器容器中的例子
- 使用 Device Mapper来改变Docker容器的大小
- linux swatch 日志监控使用笔记
- 使用Log4J监控系统日志邮件警报
- Docker使用Dockerfile创建支持ssh服务自启动的容器镜像
- 使用Log4j在程序中加入日志
- Docker使用Link在容器之间建立连接
- 使用Log4J监控系统日志邮件警报
- 使用apachetop实时监控日志、动态分析服务器运行状态
- SQL脚本:监控当前重做日志文件使用情况
- SQL脚本:监控当前重做日志文件使用情况
- CentOS 6.5 使用docker 容器
- Dockers 快速学习(四)Docker 容器的使用