我試圖發送以下JSON輸入到elasticsearch,但我得到一個解析器錯誤。Elasticsearch日期格式
這個JSON輸入
{
"chassisNumber": "654321",
"position": "40.480143, -3.688960",
"issue": "Position",
"timestamp": "2016-07-15T15:29:50+02:00[Europe/Paris]"
}
索引定義
{
"mappings":{
"vehicle":{
"properties":{
"vehicle":{
"type":"string"
},
"position":{
"type": "geo_point"
},
"issue":{
"type":"string"
},
"timestamp":{
"type":"date",
"format":"YYYY-MM-DD'T'HH:mm:ssZ"
}
}
}
}
}
並與 「時間戳」 字段關聯的錯誤。
"reason": "Invalid format: \"2016-07-15T15:29:50+02:00[Europe/Paris]\" is malformed at \"[Europe/Paris]\""
我嘗試了幾種日期格式,但沒有人成功。任何人都可以幫助我定義正確的格式來解析elasticsearch中的「時間戳」字段嗎?
謝謝!
您需要刪除'[Europe/Paris]'部分,因爲'+02:00'就足夠了,所以不需要。 – Val