Skip to content

Any way to honor the JSON Object in val.Message and not stringify it? #14

@polds

Description

@polds

Confusing title, but our Lambda functions are logging valid JSON objects and not strings like so:

{
    "fields": {
        "MediaPath": {
            "Path": "1466672936684.jpg",
        },
        "RequestID": "a7188dc9-6968-11a6-be87-3326b0d7d49d",
        "app": "purge"
    },
    "level": "info",
    "timestamp": "2016-08-23T19:36:39.382610474Z",
    "message": "success"
}

When it's passed over to cloudwatchlogs_lambda.js Sumo then sees this:

{
   "id":"32826273204296444651588478853452971566044640956554084352",
   "timestamp":1471980999382,
   "message":"{\"fields\":{\"MediaPath\":{\"Path\":\"1466672936684.jpg\"},\"RequestID\":\"a7188dc9-6968-11a6-be87-3326b0d7d49d\",\"app\":\"purge\"},\"level\":\"info\",\"timestamp\":\"2016-08-23T19:36:39.382610474Z\",\"message\":\"success\"}
",
  "requestID":null,
  "logStream":"2016/08/23/[$LATEST]8e1c1bde6beb44df800fb15f6444263a",
  "logGroup":"/aws/lambda/purge"
}

Which doesn't make it ideal to set up search queries in Sumo. Is there anyway to persist the JSON object through and have the "message" be JSON

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions