Hello,
I want to add an ingest pipeline script that will add particular fields if host.ip falls into the CIDR notation range.
I was trying some stuff but still, that does not work
The script does not return errors but fields are not added.
CIDR block = new CIDR("10.10.0.0/21"); # or def block = new CIDR("10.10.0.0/21")
for (int i = 0; i < ctx.host?.ip?.length; ++i) {
if (block.contains(ctx["host.ip"])) {
ctx["host.bo"] = "Value1";
ctx["host.bo_name"] = "Value2";
}
}
If you can spot the error and guide me It would be very helpful.
Stack is on 7.16-2