Skip to content

Commit

Permalink
fix: set hostname to meta.log.group if raw_event is enabled
Browse files Browse the repository at this point in the history
Ref: LOG-6995
Semver: patch
  • Loading branch information
Samir Musali authored and smusali committed Aug 21, 2020
1 parent 834944c commit c21646f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This file documents all notable changes in `LogDNA CloudWatch Lambda Function`. The release numbering uses [semantic versioning](http://semver.org).

## v2.2.1 - Released on August 21, 2020
* Set hostname to `meta.log.group` if `raw_event` is enabled

## v2.2.0 - Released on June 9, 2020
* Add `LOG_RAW_EVENT` environment variable option to set `line` to raw `event.message`

Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ const sendLine = (payload, config, callback) => {
if (!config.key) return callback('Missing LogDNA Ingestion Key');

// Set Hostname
const hostname = config.hostname || JSON.parse(payload[0].line).log.group;
const logGroup = config.log_raw_event ? payload[0].meta.log.group : JSON.parse(payload[0].line).log.group;
const hostname = config.hostname || logGroup;

// Prepare HTTP Request Options
const options = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "logdna-cloudwatch",
"version": "2.2.0",
"version": "2.2.1",
"description": "Lambda Functions to Stream Logs from AWS CloudWatch to LogDNA",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit c21646f

Please sign in to comment.