As I am only starting to test with ElasticStack, I have only configured 3 hosts with filebeat installed to forward apache logs to logstash. My grok filter looks like this:
As you can see, I've configured it to output the log to a failed log if it contains _grokparsefailure. There is only one format of log that gets sent to the failed log, but it happens over 20,000 times per day and it looks like this:
I marked as solved becuase what I changed based on your answer did work, but I think I did something wrong as now I am getting 4000 logs per minute in elasticsearch rather than my expected 200...
I marked as solved becuase what I changed based on your answer did work, but I think I did something wrong as now I am getting 4000 logs per minute in elasticsearch rather than my expected 200...
Unless you actually have that amount of traffic I can think of two reasons:
You have a clone filter in your configuration (which I don't think you have).
You accidentally have multiple copies of your elasticsearch output. Logstash reads all configuration files in /etc/logstash/conf.d (or whatever directory you tell it to read).
Your grok filter setup with two match settings probably works but I prefer using the documented syntax in my previous example.
I don't have any other filters in my conf.d directory. All I know is, at point #1 I added the second "match" statement that was supposed to catch all the logs that had a _grokparsefailure. At point #2 is when I raised the issue on this forum. At point #3 I removed the second "match" statement. Maybe Elasticsearch was going back through all those logs tagged as _grokparsefailure and re-indexing them according to the new filter?
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.