Я хочу отправить настраиваемый журнал в Mongodb через Fluentd. ниже представлен формат журнала:
2020-01-01 01: 34: 24,603 - recitems.views - INFO - {'id': 99, 'usercode': 'u9', 'itemcode' : 'i9', 'customercode': 'c9', 'applicationcode': 'a9', 'trackingtype': 'click', 'created': '2020-07-30T01: 34: 24.598443Z'}
Может кто-нибудь подскажет, как настроить файл conf для Fluentd? Большое спасибо!
Вот мой файл td-agent.conf.
<source>
@type tail
path /var/log/test/tracking.log
pos_file /var/log/td-agent/test.access_log.pos
<parse>
@type json # ?? i do not know how to set here
</parse>
tag mongo.apache.access
</source>
<match mongo.**>
@type mongo
database apache
collection accesslog
host localhost
port 27017
<buffer>
flush_interval 2s
</buffer>
<inject>
time_key time
</inject>
</match>