I'm setting the value of a field named "customer" depending on the value of field "destination.ip" via ingest pipeline. Currently I'm using two independent Set processors via ingest pipeline for IPv4 and IPv6. But it would be nicer to have it all together. So what I have now looks like that:
ctx['netflow'].containsKey('destination_ipv4_address') && ctx?.netflow?.destination_ipv4_address =~ /^(192.168.0.(1|2|3|4|5)|127.22.3.(1|2|3|4|5))$/
How could I have this condition all in one? I mean something like that:
ctx['netflow'].containsKey('destination_ipv4_address') && ctx?.netflow?.destination_ipv4_address =~ /^(192.168.0.(1|2|3|4|5)|127.22.3.(1|2|3|4|5))$/
OR
ctx['netflow'].containsKey('destination_ipv6_address') && ctx?.netflow?.destination_ipv6_address =~ /^(2a02.68.0.(1|2|3|4|5)|2a08.2.3.(1|2|3|4|5))$/
That means, that I could make one Set processor for each customer instead of making two Set processors for each customer (one for ipv4 and one for ipv6)