1
votes

I have Cloudwatch Agent installed on the server, and the server logs are in the following format:

2019-02-22 10:41:49,903 INFO Some log message

I have date format for the log specified in awslogs.conf the followin gway:

datetime_format = %Y-%m-%d %H:%M:%S,%f

When I check the log uploaded by the agent in the cloudwatch, I still see the date as a part of the part of each log entry, which means that the log agent doesn't correctly recognize log entry dates.

Also, in the awslogs.log I see this error: reason: timestamp could not be parsed from message.

Any ideas what's wrong with my datetime_format?

1
In this question’s description date_format looks different stackoverflow.com/q/54055252/10634638 - estinamir
datetime_format will be different for different log date time formats - Andrey

1 Answers

1
votes

The docs state that %f is "Microsecond as a decimal number, zero-padded on the left." The example that you provide looks to be milliseconds. CloudWatch doesn't support milliseconds natively right now. You'll need to consider finding a way to reformat the server logs, or use a script of some kind to transform the data first.