Open sagardesai0094 opened 3 years ago
The error seems to be happening here based on the stack trace. The describe_log_groups
function from the AWS SDK is being called with an empty string.
And for some reason, if I set the LOG_GROUP_NAME
environment variable, the log group is created. But the stream name is not what I am specifying in the conf. I even tried specifying an explicit stream name like fluentd-testing-stream
. Maybe something is really wrong with my conf?
@kenhys Could you check this issue?
@sagardesai0094
I could reproduce it.
This problem is caused by log_stream_name_key stream_name
configuration.
It seems that the configuration itself is valid, but the incoming record is not expected in this case.
Thus, when the value of stream_name
is empty - {"stream_name": ""}
, it causes InvalidParameterException
.
You can reproduce it by @type sample
by yourself.
<source>
@type sample
# OK
#sample {"stream_name": "foobar", "message": "test"}
#sample {"message": "test"}
# NG
sample {"stream_name": "", "message": "test"}
tag sample
</source>
I thought it might be related to that, so I even tried removing log_stream_name_key stream_name
and tried setting an explicit log_stream_name
like in the following config:
<label @OUTPUT>
<match **>
@type stdout
</match>
<match **>
@type cloudwatch_logs
@id out_cloudwatch_logs_containers
region "#{ENV.fetch('AWS_REGION')}"
log_group_name "/eks/fluentd-testing/containers"
# log_stream_name_key stream_name
log_stream_name fluentd-testing-stream
# remove_log_stream_name_key true
auto_create_stream true
<buffer>
flush_interval 5
chunk_limit_size 2m
queued_chunks_limit_size 32
retry_forever true
</buffer>
</match>
</label>
However this still doesn't work unless I set the LOG_GROUP_NAME
environment variable.
At least, as far as I know, fluent-plugin-cloudwatch-log does not depend on LOG_GROUP_NAME environment variable, It is strange. :confused:
Sorry, closed by mistake.
Problem
Seeing the following error:
Steps to replicate
Expected Behavior or What you need to ask
I am not sure what's causing the error. There is nothing fancy in the log group name. I have tried just using
fluentd-testing
as well.Using Fluentd and CloudWatchLogs plugin versions
v1.12.0-debian-cloudwatch-1.0
.1.12
and the plugin version seems to be0.11.2