Hi,
I have trouble with parsing a Tomcat LOG like :
2018-03-02 11:39:06,309| INFO|http-40074-7|com.capgemini.mvne.var.manager.simplicime.ecare.CoordonneesClientManager|Construction des données envoyées en sortie du WS: OK!
Although, my grok pattern works for this log on the Grok Debugger, the log isn't parsed.
Below is my filter and output in LOGSTASH.
Any help would be appreciated.
Thanks
filter {
grok {
match => [ "message" => "%{YEAR}-%{MONTHNUM}-%{MONTHDAY}\s*%{TIME}\|\s*%{LOGLEVEL:level}\|%{GREEDYDATA:tomcat_port}\|%{GREEDYDATA:requestor}\|%{GREEDYDATA:action}: %{WORD:result}" ]
}
if "_grokparsefailure" in [tags] {
drop { }
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "tomcat-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}
Not sure what's up here. Build your expression gradually by starting simple, then add more and more pieces until either you're done or things break again. Also, while doing this you should avoid GREEDYDATA except for the last one. It's very inefficient and could result in false matches that can be very confusing.
In the match bloc, after "message", when should I use "," and when "=>"
Pick one of these three syntaxes:
match => ["message", "expression"]
match => {"message" => "expression"}
match => {"message" => ["expression1", "expression2"]}
It seems to me that same error happens when it is miss usage ???
If not even ^%{YEAR:year} works then I think you're running a different configuration than you think you are. How are you starting Logstash? Any additional configuration files in /etc/logstash/conf.d or wherever you keep the files?
Magnus it starts working just for first part of the timestamp.
But as you can see below, I think, I'm using French timestamp. When I put %{YEAR:year}
it parse the right side of the date which is day in my logs.
My timestamp as in the message core is like "2018-03-02 16:18:37,168" but with match => { "message" => "%{YEAR:year }
it parse it as a day.
Your configuration can't possibly look like this because the syntax isn't valid. Try again, and format it as preformatted text so it doesn't get mangled.
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.