I am using AWS cloudwatch logs and configured my application to write the logs in compact json format with sink being rolling file. Below is the sample log from application.
{"@t":"2017-12-21T10:00:51.5955080Z","@mt":"Error {@args}","@l":"Error","args":["args","31"]}
Now the issue i am facing here with cloud watch logs is that its not picking up the timestamp from this compact json formatted logs because AWS cloudwatch logs expect first parameter to be timestamp followed by space and then followed by message.So above log needs to be in below format to be picked up by AWS cloud watch logs
2017-12-21T10:00:51.5955080Z {"@mt":"Error {@args}","@l":"Error","args":["args","31"]}
So to make my compact json logs to be processed by AWS cloudwatch logs, i need to extract the timestamp explicitly and put it before each logs ? Or does AWS doesn't provide the compact json formatted logs ? or any other workaround on this please
I have searched around this but could not get any useful info. Thanks a lot in advance.