Cloud
[fluentd] format json
'김용환'
2018. 4. 10. 18:20
아파치나 nginx로그를 fluentd로 전달하고 싶을 때 regex를 사용하는 것보다 format json을 사용하는 것이 좋다.
https://docs.fluentd.org/v0.12/articles/recipe-json-to-elasticsearch
<source>
@type tail
path /var/log/httpd-access.log #...or where you placed your Apache access log
pos_file /var/log/td-agent/httpd-access.log.pos # This is where you record file position
tag foobar.json #fluentd tag!
format json # one JSON per line
time_key time_field # optional; default = time
</source>