No commit activity in last 3 years
No release in over 3 years
This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.6
<= 2.99, >= 1.60
 Project Readme

Logstash Cloudwatch Logs Codec

Travis Build Status

Parse CloudWatch Logs subscriptions into individual events.

Installation

This plugin can be installed by Logstash's plugin tool.

bin/logstash-plugin install logstash-codec-cloudwatch_logs

Usage

At its simplest:

input {
  kinesis {
    kinesis_stream_name => "stream"
    codec => cloudwatch_logs
  }
}

Event Format

The CloudWatch Logs codec breaks each multi-event subscription record into individual events. It does this by iterating over the logEvents field, and merging each event with all other top-level fields. The codec drops the logEvents field from the final event.

For example, given a subscription record:

{
    "owner": "123456789012",
    "logGroup": "Example",
    "logStream": "Example1",
    "subscriptionFilters": [
        "RootAccess"
    ],
    "messageType": "DATA_MESSAGE",
    "logEvents": [
        {
            "id": "1",
            "timestamp": 1478014822000,
            "message": "event1"
        },
        {
            "id": "2",
            "timestamp": 1478014825000,
            "message": "event2"
        }
    ]
}

...this codec would yield two individual events:

[
  {
      "owner": "123456789012",
      "logGroup": "Example",
      "logStream": "Example1",
      "subscriptionFilters": [
          "RootAccess"
      ],
      "messageType": "DATA_MESSAGE",
      "id": "1",
      "timestamp": 1478014822000,
      "message": "event1"
  },
  {
      "owner": "123456789012",
      "logGroup": "Example",
      "logStream": "Example1",
      "subscriptionFilters": [
          "RootAccess"
      ],
      "messageType": "DATA_MESSAGE",
      "id": "2",
      "timestamp": 1478014825000,
      "message": "event2"
  }
]