In your above (earlier post), you are missing a curly brace. Not sure that is the issue, but your output is not properly terminated. You need 1 } at the bottom of output.
should look like this:
output {
if "error" in [tags] {
elasticsearch {
hosts => ["172.30.0.206:9200"]
}
}
}
I tried your configuration with the only difference that I used winlogbeat instead of nxlog (and different field names: level instead of Severity) and it works ok.
I am not sure what is the issue there.
As a diferent solution you can try drop filter. I am using this to remove very noisy events. As an example in you case it will be something like this:
#####Match type and level.
filter {
# Drop informational events
if [type] == "eventlog" and [Severity] == "WARNING" {
drop { }
}
# Drop warning events
if [type] == "eventlog" and [Severity] == "INFO" {
drop { }
}
}
*(Before you use this -if you do- check and make sure that the field names and values correspond to yours)
Logstash is starting with command sudo service logstash start
Make sure you don't have any unexpected files in /etc/logstash/conf.d. Logstash will read all files. Specifically, make sure you don't have a file containing an elasticsearch output that isn't wrapped in a conditional.
There was an unwanted file in conf.d folder. I deleted that and used drop filter by @mourlos .
And now its working. I am getting only ERROR messages .
But there is a new issue while getting logs in hipchat. I have raised a new query for it.
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.