I don't know how your "event.dataset" and "log.source.address" fields are mapped but I made an example for you to see.
If your document is like the simulation doc below, it will work.
cannot access method/field [key] from a null def reference
The method is to to take the log source address, copy into a split field with 0 representing IP and 1 representing the port so then we can source on IP only.
hence the set uses the temp array field to do this
the whole code is here
PUT _ingest/pipeline/cisco_ios_syslog_split_log_source
{
"description": "For Cisco IOS syslog events. Splits the log.source.address field into separate IP address and port fields. Stores address in log.source.address & port in log.source.port field.",
"version": 2022032401,
"on_failure": [
{
"set": {
"description": "Set 'error.message'",
"field": "error.message",
"value": "Processor {{ _ingest.on_failure_processor_type }} in pipeline {{ _ingest.on_failure_pipeline }} failed with message {{ _ingest.on_failure_message }}"
}
}
],
"processors": [
{
"split": {
"if": "ctx.tags == 'cisco-ios'",
"field": "log.source.address",
"separator": ":",
"target_field": "source_ip_port",
"ignore_missing": false
}
},
{
"set": {
"if": "ctx.containsKey('source_ip_port')",
"field": "log.source.address",
"copy_from": "source_ip_port.0"
}
},
{
"set": {
"if": "ctx.containsKey('source_ip_port')",
"field": "log.source.port",
"copy_from": "source_ip_port.1"
}
},
{
"remove": {
"if": "ctx.containsKey('source_ip_port')",
"field": "source_ip_port"
}
}
]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.