Hello,
I've been playing around with the logstash cidr filter plugin and have been coming into a couple of issues. For the most part, with most of the data sets that are coming in, this filter is working well and is doing the job. BUT, with a small amount of data (seen in the journalctl of logstash) that a warning appears and then a message of "Invaild IP Address, skipping" - example of the log is below:
Log -
[2020-07-28T09:09:03,287][WARN ][logstash.filters.cidr ][parser1] Invalid IP address, skipping {:address=>"%{[dst_ip]}", :event=>{"src_ip"=>["10.0.0.1", "10.0.0.1"], "dst_interface"=>"inside", "event"=>{"created"=>"Jul 24 05:49:25", "id"=>"166"}, "protocol"=>"TCP", "dst_ip"=>["8.8.8.8", "8.8.8.8"], "tags"=>["taging"], "observer"=>{"type"=>"firewall"}, "dst_port"=>["443", "443"], "openvpn_message"=>"%ASA-6-302013: Built inbound TCP connection 38792873 for outside:10.0.0.1/49543 (10.0.0.1/49543)(LOCAL\\USER) to inside:8.8.8.8/443 (8.8.8.8/443) (USER)", "geo_src"=>{}, "@timestamp"=>2020-07-28T09:07:59.915Z, "direction"=>"inbound", "@version"=>"1", "labels"=>"CONNECTION ", "src_interface"=>"outside", "action"=>"Built", "src_port"=>["49543", "49543"], "src_user"=>"LOCAL\\USER", "connection_id"=>"38792873"}}
The logstash cidr filter in question -
cidr {
address => [ "%{[dst_ip]}" ]
network => [ "0.0.0.0/32", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7", "127.0.0.0/8", "::1/128", "169.254.0.0/16", "fe80::/10", "224.0.0.0/4", "ff00::/8", "255.255.255.255/32", "::" ]
add_field => { "[destination][user][ip]" => "private" }
}
I have changed the address field in the cidr filter and used the below but still getting the same results.
address => [ "%{[dst_ip]}" ]
address => [ "%{dst_ip}" ]
address => [ "[dst_ip]" ]
address => [ "dst_ip" ]
I have other confs running and have the cidr filter in also and all is running well.
Well with using address => [ "%{[dst_ip]}" ].
When looking around there has been a couple of the same type of issues like :
- Cidr plugin - array fields for address input
- https://github.com/logstash-plugins/logstash-filter-cidr/issues/19
Saying this issue is closed, but seems to still in a problem?
My Question is that, how come it is working with the majority of the data incoming but only a small bit isn't? Am I missing something?
Am using:
logstash = 7.8.0
cidr filter = 3.1.3v
Thank you!