logstash gives following error in it's logs:
[2018-06-06T10:55:32,611][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"abcd-2018.06.06", :_type=>"doc", :_routing=>nil}, #LogStash::Event:0x3700c109], :response=>{"index"=>{"_index"=>"abcd-2018.06.06", "_type"=>"doc", "_id"=>"XXSO02MBfASZiwKaqhNz", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [end_time]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"For input string: "07:00:49""}}}}}
Logs I am trying to parse are:
type -1
2018-06-05 21:00:53 INFO Start:785 - Start Time in hh:mm:ss: 09:00:12 Status:success Quote No:1234 Endtime: 09:00:53 Total time in seconds:41
type-2
2018-06-05 23:00:30 ERROR Start:491 - Start Time in hh:mm:ss: 11:00:11 Status:Failure Quote No:null Exception:Element is not clickable at point (224.5,202) because another element
My .conf file looks like:
input {
beats
{port => "xyz"}
}
filter {
if ("INFO" in [message])
{
grok
{
match => { "message" => "%{TIMESTAMP_ISO8601:time_stamp} %{WORD:info} Start:%{NUMBER:snum} - Start Time in hh:mm:ss: %{TIME:start_time} Status:%{WORD:status} Quote No:%{NUMBER:q_no} Endtime: %{TIME:end_time} Total time in seconds:%{NUMBER:total_time}" }
remove_field => ["message"]
}
date
{
match => [ "time_stamp" , "YYYY-MM-dd HH:mm:ss Z" ]
}
}
else if ("ERROR" in [message])
{
grok
{
match => { "message" => "%{TIMESTAMP_ISO8601:time_stamp} %{WORD:info} Start:%{NUMBER:snum} - Start Time in hh:mm:ss: %{TIME:start_time} Status:%{WORD:status} Quote No:%{WORD:q_no} Exception:%{GREEDYDATA:exception}" }
remove_field => ["message"]
}
date
{
match => [ "time_stamp" , "YYYY-MM-dd HH:mm:ss Z" ]
}
}
}
output
{
elasticsearch {
hosts => [ "elkmonp3.newindia.co.in:9200" ]
index => "abcd-%{+YYYY.MM.dd}"
user => abc
password => abc1234
}
}
logstash Version : logstash-6.2.2