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

Record accessors with hyphens or dashes not working in cloudwatch_logs output plugin #329

Open sjhuang93 opened 1 year ago

sjhuang93 commented 1 year ago

Describe the question/issue

Record accessors with hyphens or dashes not working in cloudwatch_logs output plugin

Configuration

[OUTPUT]
    Name                  cloudwatch_logs
    Match                 *
    region                ap-northeast-1
    log_group_name        /eks/test
    log_group_template    /eks/$(kubernetes['namespace_name'])/$(kubernetes['container_name'])
    log_stream_prefix     bit
    log_stream_template   $(kubernetes['namespace_name'])/$(kubernetes['container_name']).cloudwatch_log
    log_key               log

Fluent Bit Log Output

[2023/05/18 03:13:14] [error] [record accessor] bad input character '(' at line 0
[2023/05/18 03:13:14] [error] [lib] backend failed
[2023/05/18 03:13:14] [error] [record accessor] bad input character ')' at line 0
[2023/05/18 03:13:14] [error] [record accessor] bad input character '/' at line 0
[2023/05/18 03:13:14] [error] [record accessor] syntax error, unexpected '$', expecting $end at '$(kubernetes['namespace_name'])/$(kubernetes['container_name'])'
[2023/05/18 03:13:14] [error] [output:cloudwatch_logs:cloudwatch_logs.0] Could not parse `log_group_template`
[2023/05/18 03:13:14] [error] [output:cloudwatch_logs:cloudwatch_logs.0] Initialization failed
[2023/05/18 03:13:14] [error] [output] failed to initialize 'cloudwatch_logs' plugin

Fluent Bit Version Info

image:
  public.ecr.aws/aws-observability/aws-for-fluent-bit:2.31.11