AWS cloudwatch logs datetime_format config combine multiple lines into one line

Viewed 350

I use aws cloudwatch to collect aws ecs farget task's logs.

The config is in the following pic:

log format in task definition

And I get the following logs, it is wired. Some lines with datetime is combined in one log. I think every log starts with datetime should be seen as one single log.

enter image description here

1 Answers

The %L option of awslogs-datetime-format has incorrect documentation. I had the same problem and then looked at the driver source code and %L matches .\d{3} Here`s a source link. This means it requires a leading . at the start of the pattern. You may change the format like this and it will work.

awslogs-datetime-format: '%Y-%m-%d %H:%M:%S%L'
Related