The problem i have is, that I am unable to replace @timestamp with logtime. I know, there are many topics about this, but no solution there helped me, so i decided, to make new topic, with my exact configuration and log. I do not know, what should I do. Can you help me ?
Thanks, David
No, so far as i know. Only changes i did to elastisearch config are hosts and port changes.
Actually when I ran with the configuration, you suggested (the variable logtime), it created folder in "indices" (elastisearch), like it always do, so i suggest, it recieved the data from logstash but perhaps corrupted. But then i wonder why i have no parse error from logstash.
Ok, I have some new informations. When I use the config Christian suggested (the one, that makes elastisearch 404 error), then the rudydebug output is empty.
When I try different config, that gives some results.
You are basing the date filter on the logtime field, which you are not extracting in your grok filter (which does not match what your message field looks like anyway).
That is why I am confused, that it doesn´t work the way you said.
Ofcourse in the last example it can´t work, because, there is no logtime field. I just wanted to show, that when I change the config to something else (or having different variables), I have working output.
When I posted the issue, I had different variables. GREEDYDATA:logtime was there as a string looking like this "logtime": "2018-03-28 12:00:18"
So then I thought, the date must process it, using same variables, I had no parse error or anything like that, the output was simply emtpy.
Later I also tried
filter {
grok {
match => { "message" => "\[%{GREEDYDATA:logtime}\] %{WORD:status}: %{GREEDYDATA:process}" }
}
date {
timezone => "Europe/Prague"
match => ["%{logtime}", "yyyy-MM-dd HH:mm:ss"]
target => "@timestamp"
}
}
But ouptut is still empty. I don´t know, what should I try next.
Ok all problems solved. It was all my fault, like it always is. Firstly it is OK as service, i just had to add the data after I started the service. Then I still couldnt find it in elastisearch, when I redirected the output to ES. But it was there, only I had to search index, by the old date, not the new one.
Thank you very much for your help Jenni and Christian.
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.