I am trying to parse log entries that are a combination of text and JSON. The first line is a textual representation, and the next lines are useful JSON information for the event. One possible example:
2016-07-24T21:08:07.888Z [INFO] Command completed lessonrecords-create { "key": "lessonrecords-create", "correlationId": "c1c07081-3f67-4ab3-a5e2-1b3a16c87961", "result": { "id": "9457ce88-4e6f-4084-bbea-14fff78ce5b6", "status": "NA", "private": false, "note": "Test note", "time": "2016-02-01T01:24:00.000Z", "updatedAt": "2016-07-24T21:08:07.879Z", "createdAt": "2016-07-24T21:08:07.879Z", "authorId": null, "lessonId": null, "groupId": null } }
For these entries, I am trying to define a Log Metric Filter: a) match entries; b) select data or dimensions, if possible.
According to AWS docs, the JSON template should look like this:
{ $.key = "lessonrecords-create" }
however, it does not match anything. I suppose due to mixed text and JSON in a single log entry.
So, the questions: 1. Is it possible to determine a template that will correspond to this format of the magazine? 2. Is it possible to extract sizes, values ββfrom such a magazine format? 3. Help me with a template to do this.
source share