Hi all,
I got many warning messages like this
[2019-06-21T10:34:01,663][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"cv_threat_event_all_201812", :_type=>"_doc", :routing=>nil}, #<LogStash::Event:0x6592b850>], :response=>{"index"=>{"_index"=>"cv_threat_event_all_201812", "_type"=>"_doc", "_id"=>"7tQae2sBhpHZbQ7dLP79", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception",
"reason"=>"failed to parse field [begin_time] of type [date] in document with id '7tQae2sBhpHZbQ7dLP79'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"failed to parse date field [HTTP] with format [EEE dd MMM yyyy HH:mm:ss z]", "caused_by"=>{"type"=>"date_time_parse_exception", "reason"=>"Text 'HTTP' could not be parsed at index 0"}}}}}}
Which indicate that it is trying to prase "HTTP" to type "date" which definitely won't work.
So I look into the input csv file and realize that I have some missing value.
The correct file should be the following.
timestamp,device_sn,action_id,app_id,app_name,begin_time
Sat 01 Dec 2018 01:48:12 GMT,ABC111,1,15,HTTP,Sat 01 Dec 2018 01:46:20 GMT
but some of the files are missing the app_name
Sat 01 Dec 2018 04:18:09 GMT,261030KSA2670697,6,0,,Sat 01 Dec 2018 04:17:20 GMT
Sat 01 Dec 2018 18:58:03 GMT,261030KSA2670697,6,0,,Sat 01 Dec 2018 18:50:22 GMT
So I assume logstash takes in HTTP as begin_time.
Is there any way to resolve this?