aws / aws-for-fluent-bit

The source of the amazon/aws-for-fluent-bit container image
Apache License 2.0
437 stars 130 forks source link

Set Log Rotation Dinamically #809

Open phgeraldeli opened 2 months ago

phgeraldeli commented 2 months ago

Describe the question/issue

I need to set the log rotation dinamically by using a kubernetes label. It's supported? If It is, how can i do it?

I'm using below syntax to set log group name dinamically, but when I do it with logRotation key, It does not work.

[OUTPUT]
      log_group_name $(kubernetes['labels']['my_label'])
      ...

I've tried to do the same passing log_retention_days as $(kubernetes['labels']['log_retention_days']) but It did'nt work, I wish i could do a default value as well. Something like, if it has this label use It, instead use default.

Fluent Bit Log Output

Couldn't get the log

Fluent Bit Version Info

2.31.12

Cluster Details

EKS + cloudwatch

Application Details

Steps to reproduce issue

Deploy daemonset in EKS using aws-for-fluent-bit chart Deploy a app with the specific labels Set log_group_name dinamically Do the same with logRotation Let it creates a new LogGroup Verify that is Never Expire

Related Issues