есть репа на гите: https://github.com/uken/fluent-plugin-postgres
установил нужные плагины и написал конфиг. Проблема в том, что вывод в stdout работает а в postgres нет.
Конфиг ниже. И лог в debug-e тоже.
<system>
log_level trace
</system>
<source>
@type tail
path /var/log/ibm/myapp/api/CreateObject_JavaCompute1.log
pos_file /var/log/ibm/myapp/api/CreateObject_JavaCompute1.log.pos
tag myapp.createobject
<parse>
@type regexp
expression /^(?<timed>(.*?))\|(?<info>(.*?))\|(?<thread>(.*?))\|(?<type>(.*?))\|(?<msg_id>(.*?))\|(?<obj_id>(.*?))$/
</parse>
</source>
<match myapp.createobject> <-- вот это работает, видно из лога.
@type stdout
</match>
<match myapp.createobject> <--вот это не работает. в базе ничего
@type postgres
host 172.21.13.110
port 5432
database postgres
username postgres
password password
key_names timed,info,thread,type,msg_id,obj_id
sql INSERT INTO data3 (time,type,msg_id) VALUES ($1,$4,$5)
flush_intervals 5s
</match>
Лог:
2019-10-13 16:35:50 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300
2019-10-13 16:35:53.685597983 +0500 zeus.createobject: {"timed":"11/10/2019-16:54:02:109","info":"INFO","thread":"Thread-33","type":"Response","msg_id":"A14E03EAF31043A6BB8C92468016EF90","obj_id":"56717815"}
2019-10-13 16:35:55 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300
2019-10-13 16:36:01 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300
2019-10-13 16:36:06 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300
2019-10-13 16:36:12.161715703 +0500 zeus.createobject: {"timed":"11/10/2019-16:54:02:109","info":"INFO","thread":"Thread-33","type":"Response","msg_id":"A14E03EAF31043A6BB8C92468016EF90","obj_id":"56717815"}
2019-10-13 16:36:12 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300
2019-10-13 16:36:17 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300
2019-10-13 16:36:23 +0500 [trace]: #0 enqueueing all chunks in buffer instance=70125101600300