Answer the question
In order to leave comments, you need to log in
How to tag events with a tag?
Actually the question is how to mark events with a tag? in fluentd?
here is an example of my config
<source>
@type tail
path /var/log/nginx/access.log
pos_file /var/log/td-agent/nginx-access.log.pos
tag nginx.access
format nginx
</source>
<source>
@type tail
path /var/log/nginx/error.log
pos_file /var/log/td-agent/nginx-error.log.pos
tag nginx.access
format nginx
</source>
<match nginx.access>
@type elasticsearch
logstash_format true
host 127.0.0.1
port 9200
index_name apache.access
type_name nginx
flish_interval 5s
</match>
К стандартным плагинам вывода относятся match и forward:
# Получаем события с порта 24224
<source>
type forward
port 24224
</source>
# http://this.host:9880/myapp.access?json={"event":"data"}
<source>
type http
port 9880
</source>
#Берём события, помеченные тэгами "myapp.access"
#и сохраняем их в файле/var/log/fluent/access.%Y-%m-%d
#данные можно разбивать на порции с помощью опции time_slice_format.
<match myapp.access>
type file
path /var/log/fluent/access
</match>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question