Hi,
I need to parse the field in the following input JSON via Logstash.
INPUT
{
"xyz": {
"http://com.myappliation.com/abc/def/fieldName": "value",
"id": "hsakjh-uuekjn-kj48ehu,
"http://com.myappliation.com/abc/defghii/fieldName2": "value",
"http://com.myappliation.com/abc/defhkjd/fieldName3": "value",
}
}
I need to parse the field name eg : http://com.myappliation.com/abc/defghii/fieldName2
and rename it to fieldName2
The internal JSON xyz is dynamic so I need to Identify whenever the field like this "http://abc/123/ssdf/fieldName2" will come I need to rename that field to the last dir name i.e fieldName2 in this case.
Expected Output :
{
"xyz": {
"fieldName": "value",
"id": "hsakjh-uuekjn-kj48ehu",
"fieldName2": "value",
"fieldName3": "value"
}
}
I am trying but unable to find the solution till now, also tried to use ruby filter and grok.
Thanks in Advance