Hi!
I have a nested json file in a list read as single event in Elasticsearch like this :
[{"header": {"id": "idvalue",
"datestamp": "YYYY-MM-DD"
},
"metas": {"dc:title": "text...",
"dc:id": "idvalue",
"dc:subject": [{"id": "idvalue", "title": "text"},
{"id": "idvalue", "title": "text"},
{"id4": "idvalue", "title": "text..."},
{"id": "idvalue", "title": "text"}
],
"dc:description": "long text.\r\n\r\n\r\n\r\n\r\n\r\n",
"dc:pub": [{"id": "idvalue", "title": "text..."}
],
"dc:creation": "YYY-MM-DD:HH:mm:ss",
"dc:modif": "YYY-MM-DD:HH:mm:ss",
"dc:ava": "YYY-MM-DD:HH:mm:ss",
"dc:typ": [{"id": "value", "title": "texte"}
],
"dc:ext": "HH:MM:SS",
"dc:loc": [{"lat": numvalue, "lng": numvalue}
],
"dc:lic": "text",
"dc:rH": [{"id": "value", "title": "text"}
],
"dc:aud": "text"
}
},
{"header": {"id": "idvalue",
"datestamp": "YYYY-MM-DD"
},
"metas": {"dc:title": "text...",
"dc:id": "idvalue",
"dc:subject": [{"id": "idvalue", "title": "text"},
{"id": "idvalue", "title": "text"},
{"id4": "idvalue", "title": "text..."},
{"id": "idvalue", "title": "text"}
],
"dc:description": "long text.\r\n\r\n\r\n\r\n\r\n\r\n",
"dc:pub": [{"id": "idvalue", "title": "text..."}
],
"dc:creation": "YYY-MM-DD:HH:mm:ss",
"dc:modif": "YYY-MM-DD:HH:mm:ss",
"dc:ava": "YYY-MM-DD:HH:mm:ss",
"dc:typ": [{"id": "value", "title": "texte"}
],
"dc:ext": "HH:MM:SS",
"dc:loc": [{"lat": numvalue, "lng": numvalue}
],
"dc:lic": "text",
"dc:rH": [{"id": "value", "title": "text"}
],
"dc:aud": "text"
}
},
...
]
How can I manage in the filter section (of logstash configuration file) to get an output like this :
"metas": {"title": "text...",
"id": "idvalue",
"subject": {{"id": "idvalue", "title": "text"},
{"id": "idvalue", "title": "text"},
{"id4": "idvalue", "title": "text..."},
{"id": "idvalue", "title": "text"}
},
"description": "long text.\r\n\r\n\r\n\r\n\r\n\r\n",
"pub": {{"id": "idvalue", "title": "text..."}
},
"creation": "YYY-MM-DD:HH:mm:ss",
"modif": "YYY-MM-DD:HH:mm:ss",
"ava": "YYY-MM-DD:HH:mm:ss",
"typ": {{"id": "value", "title": "texte"}
},
"ext": "HH:MM:SS",
"loc": {{"lat": numvalue, "lng": numvalue}
},
"lic": "text",
"rH": {{"id": "value", "title": "text"}
},
"aud": "text"
},
"metas": {"title": "text...",
"id": "idvalue",
"subject": {{"id": "idvalue", "title": "text"},
{"id": "idvalue", "title": "text"},
{"id4": "idvalue", "title": "text..."},
{"id": "idvalue", "title": "text"}
},
"description": "long text.\r\n\r\n\r\n\r\n\r\n\r\n",
"pub": {{"id": "idvalue", "title": "text..."}
},
"creation": "YYY-MM-DD:HH:mm:ss",
"modif": "YYY-MM-DD:HH:mm:ss",
"ava": "YYY-MM-DD:HH:mm:ss",
"typ": {{"id": "value", "title": "texte"}
},
"ext": "HH:MM:SS",
"loc": {{"lat": numvalue, "lng": numvalue}
},
"lic": "text",
"rH": {{"id": "value", "title": "text"}
},
"aud": "text"
},
....
Thanks!