aws / amazon-cloudwatch-logs-for-fluent-bit

A Fluent Bit output plugin for CloudWatch Logs
Apache License 2.0
170 stars 49 forks source link

Add verification logic to validate the existance of cloudwatch loggroup #353

Open Pixis-Akshay-Gopani opened 11 months ago

Pixis-Akshay-Gopani commented 11 months ago

Description of issue:

it looks like this plugin is not verifying the existance of cloudwatch loggroup. This plugin should first verify the presence of loggroup. if loggroup does not exist then it should call the createloggroup api.

https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit/blob/7b8dae0d6dedf942bc1e9feded197b8d1a9d261a/cloudwatch/cloudwatch.go#L69

time="2023-09-15T11:25:35Z" level=info msg="[cloudwatch 0] Log group /aws/eks/test already exists\n"

piotrgo commented 11 months ago

Hi @Pixis-Akshay-Gopani this plugin already has the functionality to create group if it doesn't exist -p "auto_create_group=true"

Cheers

Pixis-Akshay-Gopani commented 11 months ago

@piotrgo i know it has feature to auto create group. ideally it should first check the presence of loggroup. if loggroup does not exist then it should call createloggroup api. Based on fluentbit log i have found that fluentbit is not checking the presence of loggroup. it directly call the createloggroup api even if loggroup is already exist.