fluentbit-containerd-cri-o-json-log icon indicating copy to clipboard operation
fluentbit-containerd-cri-o-json-log copied to clipboard

Workaround to get Merge_Log working with native cri parser

Open aolmosj opened this issue 1 year ago • 5 comments

The current custom cri parser stores app logs with some log info (timestamp, log type...) plus the json log. This is a problem for Merge_Log, which only works when the "log" field contains only json format log. The native cri parser stores the json log in a valid way, the problem is that it's stored in the "message" field, and now the problem is that is that Merge_Log only parses the log field.

References: https://github.com/microsoft/fluentbit-containerd-cri-o-json-log/issues/4

aolmosj avatar Mar 02 '23 10:03 aolmosj

Yeah, this works for me too (I didn't understand I was using the default cri parser tho)

rdbisme avatar Aug 09 '23 17:08 rdbisme

I think youre missing the section under INPUT don't you?

henrysachs avatar Sep 01 '23 11:09 henrysachs

What do you mean?

There is no need to change the INPUT section, since this setting in the current INPUT:

Parser cri

is using the fluent-bit native cri parser.

aolmosj avatar Sep 01 '23 12:09 aolmosj

but then you dont use the cri-log parser because its never referenced?

henrysachs avatar Sep 01 '23 12:09 henrysachs

Yes, you are right. I left that unused custom parser there for future reference, since this PR is a workaround for a fluent-bit bad implementation of Merge_log. But It could be perfectly removed from the configuration.

aolmosj avatar Sep 01 '23 12:09 aolmosj