Take out the json
block and the mutate
block look at what the raw message looks like after the grok.
# mutate {
# gsub => [
# "message_detail", '\n', '',
# "message_detail", '\"\"', '"'
# ]
# }
# json {
# source => "message_detail"
# }
Example the raw message looks like this after the grok (sorry I pasted wrong one the first time)
"message_detail" => "{\n \"\"message\"\": \"\"Throw: Il prodotto estratto non è presente tra quelli del menu a tendina in fase di emissione della proposta\"\",\n \"\"level\"\": \"\"Error\"\",\n \"\"logType\"\": \"\"Default\"\",\n \"\"timeStamp\"\": \"\"2021-01-01T01:03:35.1546269+01:00\"\",\n \"\"fingerprint\"\": \"\"5f7b1c28-8f81-4cd2-afff-37a6f893ea4a\"\",\n \"\"windowsIdentity\"\": \"\"GANIT\\\\RVDI001\"\",\n \"\"machineName\"\": \"\"CL-W10RBT-003\"\",\n \"\"processName\"\": \"\"CorrettaAssunzioneANIA_Worker_Win10Produzione\"\",\n \"\"processVersion\"\": \"\"1.0.86\"\",\n \"\"jobId\"\": \"\"389178ee-a728-44be-8ef1-511060465a5e\"\",\n \"\"robotName\"\": \"\"001-VDI-Produzione\"\",\n \"\"machineId\"\": 22,\n \"\"fileName\"\": \"\"3.Emissione_Nuova_Proposta\"\",\n \"\"transactionId\"\": \"\"1fad05cb-9588-484b-b5de-a52c5e9fd29c\"\",\n \"\"queueName\"\": \"\"CorrettaAssunzioneANIA_PROD_INPUT\"\"\n}"
So I am just going through and cleaning it up with gsub
.... exactly as it looks.
I gave you 2 ways play with it ... Just go through taking parts in and out and you will learn.
I noticed this worked as well without the \
s
mutate {
gsub => [
"message_detail", '\n', '',
"message_detail", '""', '"'
]
}
Good Luck!