0
我從日誌文件中像{ 「TS」: 「1486418325.948487」}時間戳 我的基礎設施是 「filebeat」 5.2.0 - > 「elasticsearch」 5.2任何彈性搜索數據類型匹配十進制時間戳?
我試圖映射 「TS」 到「日期「 - 」epoch_second「但是文件讀取失敗。
PUT /auth_auditlog
{
"mappings": {
"auth-auditlogs": {
"properties": {
"ts": {
"type": "date",
"format": "epoch_second"
}
}
}
}
}
像
WARN Can not index event (status=400): {"type":"mapper_parsing_exception","reason":"failed to parse [ts]","caused_by":{"type":"illegal_argument_exception","reason":"Invalid format: \"1486418325.948487\""}}
的filebeat錯誤味精我嘗試使用「1486418325」是確定的,所以我想上課不接受十進制格式的時間戳。但是,python的默認輸出時間戳是這種格式。
我的目的是在elasticsearch中正確鍵入。我想用ts作爲elasticsearch的原始時間戳。 歡迎任何解決方案,除了更改原始日誌數據!
是的。使用5.x系列的ES,它附帶[日期處理器](https://www.elastic.co/guide/en/elasticsearch/reference/master/date-processor.html)來處理日期{ }在ES內部過濾,而不是在某處使用完整的logstash管道。 – sysadmin1138