I am trying to use fluent-plugin-grok-parser to parse multiple fields, following the usage in
https://github.com/kiyoto/fluent-plugin-grok-parser.
However it is found that only the first parsing could succeed.
My configs:
path /var/log/opt/cisco/elk_collect/elk_collect_stats.log
pos_file /var/log/td-agent/elk_collect_stats.log.pos
pattern "CPUUtil %{NUMBER:pam_cpu_util:float}"
pattern "KiBMemTotal %{INT:pam_mem_total_kb:integer}"
tag "#{Socket.gethostname}.elk_collect_pam_stats.log"
Sample Log Messages:
ELKDataNo 132, 2016-09-18T08:26:44 UTC, EventCount 0, ErrorCount 2932, WarningCount 2932, CPUUtil 1.4, KiBMemTotal 16433044, KiBMemUsed 3555320, KiBMemFree 12877604, KiBMemBuffer 1308
Result:
The first field pam_cpu_util could be parsed and indexed as value 1.4 successfully, while the 2nd field pam_mem_total_kb can't be parsed at all.
Is there anything wrong with my configs?
BTW, it also works if I use grok_pattern "CPUUtil %{NUMBER:pam_cpu_util:float}, KiBMemTotal %{INT:pam_mem_total_kb:integer}" instead. But this way has dependency on neighbor fields, which is not what I desires.