Fluentbit - how to configure log level filtering

386 Views Asked by At

Good morning!

I need help configuring fluentbit to do some log level filtering. I have an app, say my-app that is sending logs with a level of INFO and above to fluentbit like so:

[0] my_tag: [[1699971432.520606608, {}], {"thread"=>"main", "level"=>"INFO", "message"=>"some message", "appName"=>"my-app"}]

I have set an environment variable MY_APP_LOG_LEVEL=WARN in fluentbit, is there a way to configure it to filter incoming logs based on that env variable, to only forward WARN and above to my centralized logging system? Seems weird to me, that among filter plugins i cant really find one designed for that task. I'm currently trying to achieve my goal with grep, modify and tag rewrite filter plugins but that seems like an overkill.

Any help would be greatly appreciated!

0

There are 0 best solutions below