curl -XPUT "http://localhost:9200/citrix" -H 'Content-Type: application/json' -d'
{
"mappings" : {
"session_details" : {
"properties" : {
"ASSOCIATED_USER" : {"type": "text" },
"MACHINE_NAME" : {"type": "text" },
"DELIVERY_GROUP" : { "type" : "keyword" },
"SESSION_START_TIME" : { "type" : "date" },
"SESSION_END_TIME" : { "type" : "date" },
"SESSION_DURATION" : { "type" : "text" }
}
}
}
}'
I am facing an error, here is message
[WARN ] 2018-06-26 15:13:29.039 [Ruby-0-Thread-8@[main]>worker3: :1] elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"citrix", :_type=>"session_details", :_routing=>nil}, #LogStash::Event:0x9515996], :response=>{"index"=>{"_index"=>"citrix", "_type"=>"session_details", "_id"=>"dUKDPWQBRAHJjbi02-KY", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [SESSION_START_TIME]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: "6/7/2018 9:56:41 AM" is malformed at "/7/2018 9:56:41 AM""}}}}}
data: csv file
A.Sivasan,CTXPW021,Apps,6/07/2018 4:40:22 PM,6/7/2018 4:41:06 PM,0:0
P.Kumar,CTXPW128,Apps,6/8/2018 3:10:07 AM,6/8/2018 11:11:23 AM,8:1
tjenning.h,CTXPW317,Desktop,6/5/2018 7:41:59 AM,6/6/2018 12:58:54 AM,17:16
jerome.huang,CTXPW255,Desktop,6/7/2018 11:16:09 AM,6/8/2018 12:33:16 AM,13:17
shaik.rasool,CTXPW356,Desktop,6/7/2018 12:08:55 AM,6/7/2018 1:38:07 AM,1:29
P.Kodandak,CTXPW185,Desktop 2013,6/8/2018 3:27:30 AM,6/8/2018 9:38:18 PM,18:10
annetria.holty,CTXPW493,Desktop 2013,6/4/2018 10:46:49 AM,6/4/2018 4:58:39 PM,6:11
Logstash config file
input {
file{
path => "Details.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["ASSOCIATED_USER","MACHINE_NAME","DELIVERY_GROUP","SESSION_START_TIME","SESSION_END_TIME","SESSION_DURATION"]
}
date {
match => [ "SESSION_START_TIME","d/M/YYYY hh:mm:ss aa","dd/MM/YYYY hh:mm:ss aa"]
}
}
output {
elasticsearch {
hosts => "localhost"
index => "citrix"
document_type => "session_details"
}
stdout {}
}
could someone please help on date parse error.
Thank you
Ashwin Vemula