Skip to content

Set Log Rotation Dinamically #809

Description

@phgeraldeli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request or enhancement on existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions