Merging JSON files

Hello everyone,

100% newbie here. Thank you for your patience.

I'm trying to merge two simple json files under certain condition. Is that possible? Any direction is useful.

JSON_1

{
    "name_1" : "John",
    "age_1": 25
}

JSON_2

{
    "name_2" : "John",
    "company" : "xyz"
}

So, if "name_1" is equal to "name_2", I would like to merge JSON files and change "name_1" and "name_2" to just "name". Output would be:

{
     "name": "John",
     "age_1": 25,
     "company" : "xyz"
}

Merging JSONs with JavaScript is easy, but I would like to do it with Elastisearch too.

Any help is appreciated. Thank you very much.

I just found this question answered. I'm trying to figure out if I can combine fields in Kibana.

I have JSON files loaded under the same index. Two different types under the same index to be precise. I loaded both via logstash. I would need to merge fields somehow. Any direction is appreciated.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.