Hello,
I am trying to map an IP address to a hostname with an If statement on an ingest pipeline.
These IPs are not in DNS and need to have a hostname associated to them for reporting.
If I remove the "if" statement, the set processor works fine. I have tried variations on matching with If: and am not having any luck.
This is using the NetFlow module for Filebeats.
"filebeat-7.5.2-netflow-log-pipeline" : {
"description" : "Pipeline for Filebeat NetFlow",
"processors" : [
{
"geoip" : {
"if" : "ctx.source?.geo == null",
"field" : "source.ip",
"target_field" : "source.geo",
"ignore_missing" : true
}
},
{
"geoip" : {
"field" : "destination.ip",
"target_field" : "destination.geo",
"ignore_missing" : true,
"if" : "ctx.destination?.geo == null"
}
},
{
"geoip" : {
"database_file" : "GeoLite2-ASN.mmdb",
"field" : "source.ip",
"target_field" : "source.as",
"properties" : [
"asn",
"organization_name"
],
"ignore_missing" : true
}
},
{
"geoip" : {
"properties" : [
"asn",
"organization_name"
],
"ignore_missing" : true,
"database_file" : "GeoLite2-ASN.mmdb",
"field" : "destination.ip",
"target_field" : "destination.as"
}
},
{
"rename" : {
"field" : "source.as.asn",
"target_field" : "source.as.number",
"ignore_missing" : true
}
},
{
"rename" : {
"ignore_missing" : true,
"field" : "source.as.organization_name",
"target_field" : "source.as.organization.name"
}
},
{
"rename" : {
"target_field" : "destination.as.number",
"ignore_missing" : true,
"field" : "destination.as.asn"
}
},
{
"rename" : {
"field" : "destination.as.organization_name",
"target_field" : "destination.as.organization.name",
"ignore_missing" : true
}
},
{
"set" : {
"if" : "observer.ip == X.X.X.X",
"field" : "observer.hostname",
"value" : "HOSTNAME-HERE"
}
}
],
"on_failure" : [
{
"set" : {
"value" : "{{ _ingest.on_failure_message }}",
"field" : "error.message"
}
}
]
}
Thanks,
Jake