Инструменты пользователя

Инструменты сайта


linux:fluentd

Это старая версия документа!


Fluentd

:!: td-agent

Пример конфига агента для отправки в ELK

####
## Output descriptions:
##
 
<source>
  @type tail
  <parse>
    @type regexp
    expression /^(?<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3})[ ]+\[(?<thread>[^ ]+)\][ ]+(?<level>[^ ]+)[ ]+(?<class>[^ ]+)[ ]+\- (?<message>.*)/
  </parse>
  path C:\my_service\logs\my_service.log
  pos_file C:\td-agent\pos\my_service.pos
  tag my_service_log
</source>
 
<match my_service_log>
  @type record_modifier
  <record>
    host "2.2.2.0"
  </record>
  tag my_service
</match>
 
#<filter my_service>
#  @type grep
#  <regexp>
#    key level
#    pattern /info/i
#  </regexp>
#</filter>
 
<match my_service>
  @type elasticsearch
  host 1.1.1.1
  port 9200
  logstash_format true
  logstash_prefix my_service
  user --
  password --
  reconnect_on_error true
  reload_on_failure true
  reload_connections false
  log_es_400_reason true
  request_timeout 15s
  <buffer>
    @type memory
    chunk_limit_records 1000
    chunk_limit_size 2M
    queue_limit_length 100
    queued_chunks_limit_size 200
    overflow_action block
    retry_max_interval 10
    retry_randomize true
    retry_max_times 3
    flush_interval 5
    flush_mode interval
    flush_thread_count 5
  </buffer>
</match>

Файл лежит в папке «etc/td-agent/config.d/«
а штатный конфиг, «td-agent.conf», содержит строку »@include config.d/*.conf»

:!:
linux/fluentd.1695270236.txt.gz · Последнее изменение: 2023/09/21 04:23 — admin