I am trying to drop events every time the field [dns.resolved_ip] is ''. I have tried multiple approachs but without successs.
"reason"=>"failed to parse field [dns.resolved_ip] of type [ip] in document with id 'G5mrqYABOI1CdVDindTb'. Preview of field's value: ''", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"'' is not an IP string literal."
Two filters i tried to use:
filter {
if [agent][type] == "packetbeat" {
if ![dns][resolved_ip] {
drop{}
}
}
}
and i also have tried:
filter {
if [agent][type] == "packetbeat" {
if [dns][resolved_ip] == "<nil>" { #i also tried with "'<nil>'"
drop{}
}
}
}
The condition if [agent][type] == "packetbeat" is being met, since i have a remove_fields and it is working. I can see the documents being indexed on elastic without the fields i removed.
Like this:
filter {
if [agent][type] == "packetbeat" {
if [dns][resolved_ip] == "<nil>" {
drop {}
}
mutate {
remove_field => ["[dns][additionals_count]", "[dns][opt][udp_size]"]
}
}
}
Your solution seems to work! (from the time interval that i am checking the logs, they didn't appear again)
Thank you very much for both of your answers.
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.