awslogs
awslogs copied to clipboard
Changing the format of the logs
Hi! Thanks for this package! I was looking around and couldn't find a way to change the format of the logs but I thought you probably have a way to do that? For example, how can I remove the logstream name or the timestamp from the logs?
Example:
2022-11-03T16:01:04.010000+00:00 2022/11/03/[$LATEST]58asd312e7212131223124ae149 [INFO] 2022-11-03T16:01:04.010Z 70sadasbd-xxasaa9-5b70-a2ea-6860xasdasdas637ee5 Hey this is an actual log
I just want the part Hey this is an actual log
Thanks!
Hi! What is the exact command and arguments that you're trying?
As the help of the command shows, you can control some information in the output:
$ awslogs get --help
[...]
-G, --no-group Do not display group name
-S, --no-stream Do not display stream name
--timestamp Add creation timestamp to the output
--ingestion-time Add ingestion time to the output
[...]
Also, you can use a CloudWatch Logs Filter pattern.
Hi! Thanks for the help. I thank that will definitely improve it. I was looking for something like the usual --format "...." where you can specify everything, like the format of the date and everything else. But that will certainly help. Thanks!