Marthon docker 配置fluent示例,加上tag,进行后期fluent进行分类处理更方便。
"parameters": [
{
"key": "log-driver",
"value": "fluentd"
},
{
"key": "log-opt",
"value": "fluentd-address=172.16.4.85:24225"
},
{
"key": "log-opt",
"value": "tag=docker." ### 此处 docker. 和下面的第二个match匹配 ,docker.subtag1 和第一个match匹配,匹配规则直到满足的第一个match就不在向下匹配
}
]
################ fluent docker config ################
<source>
@type forward
port 24225
bind 172.16.5.21
</source>
<match docker.subtag1>
@type kafka_buffered
# list of seed brokers
brokers 172.16.6.11:9092,172.16.6.12:9092,172.16.6.13:9092
# buffer settings
buffer_type file
buffer_path /data/log/td-agent/buffer/td/docker_data1
flush_interval 3s
# topic settings
default_topic testfluentd
# data type settings
output_data_type json
include_time_key true
include_tag_key true
### compression_codec snappy
# producer settings
max_send_retries 1
required_acks 1
</match>
<match docker.*>
@type kafka_buffered
# list of seed brokers
brokers 172.16.6.11:9092,172.16.6.12:9092,172.16.6.13:9092
# buffer settings
buffer_type file
### 此处的buffer的位置和上面的不能放在同一个位置
buffer_path /data/log/td-agent/buffer/td/docker_data2
flush_interval 3s
# topic settings
default_topic test_fluentd
# data type settings
output_data_type json
include_time_key true
include_tag_key true
### compression_codec snappy
# producer settings
max_send_retries 1
required_acks 1
</match>
### 所有 不满足上面格式的数据都会进到下面
<match **>
@type stdout
</match>
Marthon docker 配置fluent示例 以及tag使用
最新推荐文章于 2024-06-20 17:47:44 发布