How to parse mixed text and JSON log entries in AWS CloudWatch for Log Metric Filter

后端 未结 3 1289
滥情空心
滥情空心 2021-02-18 19:08

I am trying to parse log entries which are a mix of text and JSON. The first line is text representation and the next lines are JSON payload of the event. One of the possible ex

3条回答
  •  执念已碎
    2021-02-18 19:22

    you can use fluentd agent to send logs to Cloudwatch. Create custom grok pattern based on your metric filter.

    Steps:

    • Install fluentd agent in your server
    • Install fluent-plugin-cloudwatch-logs plugin and fluent-plugin-grok-parser plugin
    • write your custom grok pattern based on your log format

      please refer this blog for more information

提交回复
热议问题