Could you please help me with drop logstash filter?
I have field 'username' and I want to drop all records for specific usernames.
Please correct my filter if it is wrong:
if ["Pete", "John", "Bill", "Greg", "Paul McCartney"] in [username] {
drop { }
}
Right now it's
"If the username contains this array ..."
That a) won't happen and b) isn't valid syntax in Logstash. (I think you can not define arrays directly in the conditions?)
Three possible solutions:
If you had a field containing that array, you could probably write if [username] in [namelist]
You could just concatenate all your conditions :if [username] == "Pete" or [username] == ...
You could use a regular expression: if [username] =~ /Pete|John|Bill|Greg|Paul McCartney/
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.