Is it possible to send my application's JSON log output to Cloudwatch using awslogs agent?

Viewed 83

I have a python application (dockerised) which output's logs in JSON format. I'd like to send these logs to Cloudwatch. To avoid making any code changes i was hoping to use the awslogs Cloudwatch agent to sync the log file to Cloudwatch, but after looking at the Cloudwatch agent's timestamp format field 'timestamp_format', it's expecting my application to output the timestamp in a format like:

datetime_format = %d-%b-%Y %H:%M:%S UTC

But my application logs the timestamp as JSON value, e.g:

{"log":"{\"levelname\": \"INFO\", \"message\": \"example log\", \"filename\": \"application.py\", "time":"2022-05-16T11:36:03.04390948Z"}

Is it possible for me to send these logs to Cloudwatch using the agent? If not, what would be the best alternative? Thank you

0 Answers
Related