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

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

Nothing logged when log_key is specified #242

Closed holstvoogd closed 2 years ago

holstvoogd commented 2 years ago

Hi, I must be missing something, but it seems like when I set log_key, nothing happens anymore.

My fluent config:

[SERVICE]
  grace                     30
  flush                     1
  log_level                 debug
  storage.path              /var/log/flb-storage/
  storage.sync              normal
  storage.checksum          off
  storage.backlog.mem_limit 5M

[INPUT]
  name          forward
  host          localhost
  port          24224
  mem_buf_limit 10M

[OUTPUT]
  name                cloudwatch
  match               *
  region              eu-central-1
  log_group_name      $(log_group_name)
  log_stream_name     $(log_stream_name)
  log_key             message
  auto_create_group   true
  log_retention_days  365
  retry_limit         false

When I remove the log_key, my log lines look like this do instance:

{"log_group_name":"test","log_stream_name":"test-2","message":{"foo":"bar baz!"}}

However with the log_key set, nothing is pushed to CW.

Without log_key, the debug log looks like:

[2022/04/07 15:47:53] [ info] [sp] stream processor started
[2022/04/07 15:48:03] [debug] [input chunk] update output instances with new chunk size diff=86
[2022/04/07 15:48:03] [debug] [task] created task=0x408c6b7280 id=0 OK
time="2022-04-07T15:48:03Z" level=info msg="[cloudwatch 0] Log group test already exists\n"
time="2022-04-07T15:48:03Z" level=info msg="[cloudwatch 0] Set retention policy on log group test to 365d\n"
[2022/04/07 15:48:03] [debug] [out coro] cb_destroy coro_id=0
[2022/04/07 15:48:03] [debug] [task] destroy task=0x408c6b7280 (task_id=0)

And with log_key set:

 [2022/04/07 15:49:24] [debug] [input chunk] update output instances with new chunk size diff=86
 [2022/04/07 15:49:25] [debug] [task] created task=0x408ef38280 id=0 OK
 [2022/04/07 15:49:25] [debug] [out coro] cb_destroy coro_id=0
 [2022/04/07 15:49:25] [debug] [task] destroy task=0x408ef38280 (task_id=0)

I am using the latest aws provided container.

What am I missing/doing wrong here?

zhonghui12 commented 2 years ago

Hi @holstvoogd , could you please attach more logs here? or it just shows above? Also, we recommend to use our high performance C plugin cloudwatch_logs now.

zhonghui12 commented 2 years ago

Close this issue for no response. Please feel free to reopen it if needed.