使用logstash我试图在elasticsearch中以json格式导入日期。
我使用以下映射:
"time_stamp": {
"type": "date",
"format": "dd-MMM-yy HH:mm:ss aa zzz"
}
并尝试导入09-Dec-16 6:15:00 PM GMT
并获得以下错误。
[2017-01-12T15:41:34,501][WARN ][logstash.outputs.elasticsearch] Failed action. {
: status=>400,
: action=>[
"index",
{
: _id=>nil,
: _index=>"energy-2017.01.12",
: _type=>"pam1",
: _routing=>nil
},
2017-01-12T15: 41: 34.397Z%{
host
}%{
message
}
],
: response=>{
"index"=>{
"_index"=>"energy-2017.01.12",
"_type"=>"pam1",
"_id"=>"AVmTV2GcrRd08tiPC0IZ",
"status"=>400,
"error"=>{
"type"=>"mapper_parsing_exception",
"reason"=>"failed to parse [time_stamp]",
"caused_by"=>{
"type"=>"illegal_argument_exception",
"reason"=>"Invalid format: \"09-Dec-16 6:15:00 PM GMT\" is malformed at \"-Dec-16 6:15:00 PM GMT\""
}
}
}
}
我收到此错误的任何想法?