Demo entry 6846819

fluentd配置

   

Submitted by anonymous on Jun 27, 2019 at 05:17
Language: YAML. Code size: 1.5 kB.

# Fluentd ConfigMap, 包含了配置文件。  
kind: ConfigMap  
apiVersion: v1  
data:  
  forward.input.conf: |-  
    # Takes the messages sent over TCP  
    <source>  
      type forward  
    </source>  
    <source>  
      type tail  
      path /var/lib/kubelet/pods/*/volumes/kubernetes.io~empty-dir/*/*.log  
      exclude_path ["/var/lib/kubelet/pods/*/volumes/kubernetes.io~empty-dir/*/*_water_0_.log"]  
      pos_file /var/lib/kubelet/pods/log.pos  
      tag ${tag}  
      format json  
      time_key time  
      time_format %Y-%m-%d %H:%M:%S.%L%s  
      #keep_time_key true  
    </source>  
  output.conf: |-  
    <match **>  
       type elasticsearch  
       log_level trace  
       #include_tag_key false  
       #include_timestamp true  
       #time_key_exclude_timestamp true  
       #time_key_exclude_timestamp true  
       #time_key @timestamp  
       #keep_time_key false  
       #time_key_format %Y-%m-%d %H:%M:%S.%L  
       host elasticsearch  
       port 9200  
       logstash_format true  
       # Set the chunk limits.  
       buffer_chunk_limit 2M  
       buffer_queue_limit 8  
       flush_interval 5s  
       # Never wait longer than 5 minutes between retries.  
       max_retry_wait 30  
       # Disable the limit on the number of retries (retry forever).  
       disable_retry_limit  
       # Use multiple threads for processing.  
       num_threads 2  
    </match>  
metadata:  
  name: fluentd-es-config  
  namespace: logging  

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).