I have the following filter set up to drop certain logs and add tags to syslog events from my Sophos XG550 firewalls:
input {
tcp {
port => 6000
type => syslog
}
udp {
port => 6000
type => syslog
}
}
filter {
# Drop DHCP packets
if [log_component] == "DHCP Server" {
drop { }
}
}
filter {
if [device_name] == "XG550" {
mutate {
add_tag => [ "Sophos" ]
}
}
}
filter {
if "Sophos" in [tags] {
...
}
...
The filters for dropping the DHCP server traffic and adding the Sophos tag are not working. Since I use the Sophos tag to filter the output later in the config, nothing gets output. The only way I can get it to work is to add the tag as part of the input. Since I'll probably end up re-using the input block for other syslog sources I don't want to do that.
Am I missing something? Here's the raw data of a message received:
{
"_index": "sophos_xg-2020.03.04",
"_type": "doc",
"_id": "JGMLp3ABhBEk_dXgm73n",
"_version": 1,
"_score": null,
"_source": {
"raw_data": "192.168.10.161\tWed 04 Mar 19:18:55 2020\tWed 04 Mar 23:18:55 2020\tb0:35:9f:xx:xx:xx\tDESKTOP-xxxxx",
"<30>device": "SFW",
"date": "2020-03-04",
"log_subtype": "System",
"device_name": "XG550",
"log_component": "DHCP Server",
"tags": [
"_geoip_lookup_failure"
],
"timezone": "GMT",
"log_id": "063411660020",
"@version": "1",
"priority": "Information",
"ipaddress": "192.168.10.161",
"client_physical_address": "b0:35:9f:xx:xx:xx",
"message": "Lease IP 192.168.10.161 renewed for MAC b0:35:9f:xx:xx:xx",
"type": "syslog",
"time": "19:35:20",
"device_id": "xxxxxxxxxxx",
"log_type": "Event",
"host": "172.20.200.50",
"status": "Renew",
"@timestamp": "2020-03-04T19:35:20.476Z"
},
"fields": {
"date": [
"2020-03-04T00:00:00.000Z"
],
"@timestamp": [
"2020-03-04T19:35:20.476Z"
]
},
"highlight": {
"log_subtype": [
"@kibana-highlighted-field@System@/kibana-highlighted-field@"
]
},
"sort": [
1583350520476
]
}