1
我遇到了從JSON解析中設置時間戳的問題。Logstash - 從JSON解析對象中設置時間戳
我有這個字符串:
[{"orderNumber":"423523-4325-3212-4235-463a72e76fe8","externalOrderNumber":"reactivate_22d6ff0d8f55eb821be14df9d35505a6","operation":{"name":"CAPTURE","amount":134,"status":"SUCCESS","createdAt":"2015-05-11T09:14:30.969Z","updatedAt":{}}}]
我解析它作爲使用這種Logstash濾波器JSON:
grok {
match => { "message" => "\[%{GREEDYDATA:firstjson}\]%{SPACE} \[%{GREEDYDATA:secondjson}\}]}]"}
}
json{
source => "firstjson"
}
date {
match => [ "operation.createdAt", "ISO8601"]
}
mutate {
remove_field => [ "firstjson", "secondjson" ]
}
}
這將創建ElasticSearch內的文件。我有一個名爲operation.createdAt的字段,它被正確識別爲日期字段。但由於某種原因,此行:
date {
match => [ "operation.createdAt", "ISO8601"]
}
未設置@timestamp字段。當前@時間戳字段在文檔插入時設置。我究竟做錯了什麼?