I have the following json code, it has a nested fields and I'm trying to make it flat but I couldn't!
Here is the source json file
{
"body": {
"BlockName": "SA",
"input": {
"type": "array",
"identification": "iValue",
"configs": {},
"information": {
"location": "Users\\files\\",
"client_id": "abd"
},
"value": {
"info": [
"Apple",
"MSFT",
"AVB"
],
"domains": [],
"uniqueId": "1108738857225224193",
"restul_set": [
0.4112226366996765,
0.34098902344703674,
0.24778836965560913
],
"timestamp": 1554940800000,
"text": "Test Text"
}
}
},
"result": 0.06
}
here is what I'm looking for:
{
"body.BlockName": "SA",
"body.input.type": "array",
"body.input.identification": "iValue",
"body.input.configs": {},
"body.input.information.location": "Users\\files\\",
"body.input.information.client_id": "abd",
"body.input.value.info": [
"Apple",
"MSFT",
"AVB"
],
"body.input.value.domains": [],
"body.input.value.uniqueId": "1108738857225224193",
"body.input.value.restul_set": [
0.4112226366996765,
0.34098902344703674,
0.24778836965560913
],
"body.input.value.timestamp": 1554940800000,
"body.input.value.text": "Test Text",
"result": 0.06
}
and here is the logstash config file:
input {
exec{
command => "cat /usr/share/logstash/data/pipelineOutput.json"
codec => json
interval => 60
}
}
filter {
split {
field => "[body]"
}
}
output {
stdout {
codec => json
}
}
any ideas?