I need to parse a specific message from a log file with fluent-bit and send it to a file. All messages should be send to stdout and every message containing a specific string should be sent to a file. I have managed to do it with a filter with the following configuration
[SERVICE]
Flush 1
Log_Level info
[INPUT]
Name tail
Path inputfile.log
Tag test_tag
[FILTER]
Name rewrite_tag
Match test_tag
Rule $log (user_temporarily_disabled) from.$TAG.new true
Emitter_Name re_emitted
[OUTPUT]
Name stdout
Match test_tag
[OUTPUT]
Name file
Match from.*
File myoutput.log
With the following configuration whenever i send a line to the input file it goes to stdout in any case and it goes to file if the line contains the "user_temporarily_disabled" string. This is achieved by rewriting the tag with the rewrite_tag filter.
What i need more is to parse the message and rewrite it a new form. I have tried to add a Parser with no success