How to filter and transform log events in an EC2 instance before CloudWatch Logs Agent sends them to AWS

Viewed 150

I'm looking for a way to filter and transform logs before they are sent to AWS by CloudWatch Logs Agent.

Let's assume I'm using a third party software which generates logs on an EC2 instance. The problems that I'm trying to solve are:

  1. Not sending all the logs generated by the third party software, there are too many logs generated and only a few of them are valuable
  2. The logs are not in JSON and I'm interested in transforming them into one before sending them to CloudWatch (for search purposes)

Is this possible and how?

0 Answers
Related