Fluentd常用配置文件方案

<source>
  type forward
  port 24224
  bind 0.0.0.0
</source>
 
<match *.system_out.reformed.docker.*.*.**>
  type forest
  subtype file
  <template>
    output_tag false
    output_time false
    message_key log
    format single_value
    time_slice_format %Y%m%dT%H
    path /home/work/fluentd-log/${tag_parts[4]}/${tag_parts[5]}/system_out/${tag_parts[0]}.docker_log
    buffer_chunk_limit 256m
    buffer_queue_limit 128
    flush_interval 3m
    disable_retry_limit false
    retry_limit 17
    retry_wait 1s
  </template>
</match>
 
<match *.system_err.reformed.docker.*.*.**>
  type forest
  subtype file
  <template>
    output_tag false
    output_time false
    message_key log
    format single_value
    time_slice_format %Y%m%dT%H
    path /home/work/fluentd-log/${tag_parts[4]}/${tag_parts[5]}/system_err/${tag_parts[0]}.docker_log
    buffer_chunk_limit 256m
    buffer_queue_limit 128
    flush_interval 3m
    disable_retry_limit false
    retry_limit 17
    retry_wait 1s
  </template>
</match>
 
<match fluent.*>
  type forest
  subtype file
  <template>
    time_slice_format %Y%m%dT%H
    path /home/work/fluentd-log/fluentd-server-log/${tag_parts[1]}/fluentd_client_log
    buffer_chunk_limit 256m
    buffer_queue_limit 128
    flush_interval 3m
    disable_retry_limit false
    retry_limit 17
    retry_wait 1s
  </template>
</match>
<source>
  type forward
  port 24224
  bind 0.0.0.0
</source>
 
<match docker.**>
  type record_reformer
  tag reformed.${tag}
  local_time ${time.strftime('%Y-%m-%d-%H')}
</match>

<match reformed.docker.**>
  type rewrite_tag_filter
  rewriterule1 source stdout system_out.${tag}
  rewriterule2 source stderr system_err.${tag}
</match>

<match system_err.**>
  type rewrite_tag_filter
  rewriterule1 local_time ^(.+)$ $1.${tag}
</match>

<match system_out.**>
  type rewrite_tag_filter
  rewriterule1 local_time ^(.+)$ $1.${tag}
</match>
 
<match **>
    type forward
    <server>
      host 192.168.126.136
      port 24224
      weight 30
    </server>
    <server>
      host 192.168.126.137
      port 24224
      weight 30
    </server>
    flush_interval 5s
</match>

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部