0
當我們創建基於時間的索引時,elasticsearch/kibana需要一個名爲「_timestamp」的字段。我們可以在elasticsearch中使用Unix時間戳作爲_timestamp字段
我發現這個字段應該是一個字符串。
但是在我的日誌中,Unix時間戳是必需的段。
當我們創建基於時間的索引時,elasticsearch/kibana需要一個名爲「_timestamp」的字段。我們可以在elasticsearch中使用Unix時間戳作爲_timestamp字段
我發現這個字段應該是一個字符串。
但是在我的日誌中,Unix時間戳是必需的段。
是的,您可以在Date
類型字段中存儲unix時間戳。但請確保您使用適當的format
,如epoch_millis
以毫秒爲單位的時間戳,epoch_second
以秒爲單位的時間戳。
timestamp
字段的示例映射,其中存儲以秒爲單位的unix時間戳。
PUT my-index
{
"mappings": {
"my-type": {
"properties": {
"timestamp": {
"type": "date",
"format": "epoch_second"
}
}
}
}
}
你可以找到更多信息here