My log is JSON format, and inside the “message” label i have some other JSON formatted text, but it is not displayed as JSON. It is displayed like this:
“@timestamp”: “2023-01-11T12:49:35.456Z”,
“@version”: “1”,
“logger”: “example”,
“level”: “infoerrordebug”,
“message”: “key: value { \n class Example { \n timestamp: 2023-01-11T12:49:34Z eventType:exampleValue \n key: value \n key:value \n } key4: value4 \n key5:value5 \n key6:value6 \n key7:value7 \n info: value \n key8:value8 \n ErrorCode: 15 \n dateErrorOverriden: null \n}”,*
“stacktrace”: “”,
“thread”: “eventsExecutor-33”
How can i make the text in the “message” label to also be displayed also as JSON?
@pooh thanks for the explanation. I am currently having another issue. I am trying to display some labels and their values in a table and i can’t figure it out. In splunk was enough to write: table label1 label2 label3.
As someone above already pointed out, the message field isn’t actually json formatted because it doesn’t have the comma separator nor does it have the double quote (which should be escaped) that normally enclose all json fields.
But, if it’s indeed JSON format and you were just trying to put down some example by hand, you should be able to double parse your log lines. For example: