【发布时间】:2016-03-01 08:53:12
【问题描述】:
我收到以下异常:
ElasticsearchParseException[failed to parse date field [2016-02-20T22:00:00.000Z], tried both date format [dateOptionalTime], and timestamp number]; nested: IllegalArgumentException[Invalid format: \"2016-02-20T22:00:00.000Z\"]
关于以下查询:
curl -XGET https://xxxx.us-east-1.es.amazonaws.com/yyy/zzz/_search?pretty=true -d '
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"range": {
"event_timestamp": {
"gte": "2016-02-20T22:00:00.000Z",
"lte": "2016-02-27T22:00:00.000Z"
}
}
}
]
}
}
}
}
}
'
event_timestamp 映射为:
"event_timestamp":{"type":"date","format":"dateOptionalTime"}
一个示例条目是:
{
"_index" : "yyy",
"_type" : "zzz",
"_id" : "abcde",
"_score" : 1.0,
"_source":{"event":"xxx","client_timestamp":"1456347863865","event_timestamp":"2016-02-24T21:04:23.495Z","partitionKey":"xxx"}
【问题讨论】:
-
dateOptionalTime是您的自定义格式吗?? -
其实我没有指定,当我为基于时间的索引选择这个字段作为所谓的“时间字段名称”时 kibana 输入的内容
标签: date parsing exception elasticsearch