Hello everyone,
First of all, I am new to Logstash, so I would not be surprised if what I am asking is not within the scope of what Logstash can do.
So, I am working on a project where I need to do multiple GeoIP lookups on a nested json string. Here is what the input string would look like, beautified:
{
"testid": "abdc",
"ipversion": "v4",
"flow": [
{
"destination_port": 33434,
"dub": [
{
"index": 1,
"ip": "192.168.1.254"
},
{
"index": 2,
"ip": "82.255.159.254"
},
{
"index": 3,
"ip": "82.255.210.12"
}
]
},
{
"destination_port": 33438,
"dub": [
{
"index": 1,
"ip": "172.2.12.12"
},
{
"index": 2,
"ip": "84.8.15.123"
}
]
}
]
}
What I want is to add a GeoIP lookup result field under each "ip" field. I tried to brute-force it by applying filters to every field of the array (even non-existent ones), which worked but was very ugly. I am wondering if there exists a cleaner way to do it by using the Split filter or some other trick I am not yet aware of.
Many thanks in advance,