kibana上的时间戳格式错误

aiazj4mn  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(1)|浏览(563)

我是kibana的新手,目前我正在与aws waf合作,我正在使用kibana可视化我的waf日志。但时间戳格式有问题,是数字格式,而不是日期格式。

我尝试添加\u时间戳格式,但由于时间戳错误,日志没有显示。谢谢。
样品记录
{“timestamp”:1608166564696,“formatversion”:1,“webaclid”:arn:aws:wafv2:ap-southeast-1:regional/webacl/***/“,”terminatingruleid“:”default\u action“,”terminatingruletype“:”regular“,”action“:”allow“,”terminatingrulematchdetails“:[],”httpsourcename“:”alb“,”httpsourceid“:”—app/api staging waf/a4cc29fda18b3ac2“,“rulegrouplist”:[{“rulegroupid”:“regional/rulegroup/sqli\u prevention/a9616e2c-0c1f-4a7b-9278-8”,“terminatingrule”:null,“nonterminatingmatchingrules”:[],“excludedrules”:null}],“ratebasedrulelist”:[],“nonterminatingmatchingrules”:[],“httprequest”:{“clientip”:“10.90.40.000”,“country”:“-”,“headers”:[{“name”:“host”,“value”:“api.com”},{“name”:“content length”,“value”:“81”},{“name”:“content type”,“value”:“application/json”},{“name”:“authorization”,“value”:“redacted”},{“name”:“accept encoding”,“value”:“gzip”},{“name”:“user agent”,“value”:“http client/2.0”}],“uri”:“/notification/”,“args”:“,“httpversion”:“http/2.0”,“httpmethod”:“post”,“requestid”:“1-5fdaaca4-5d4a7a83048d7bb54ded7d0c”}}块引号

uklbhaso

uklbhaso1#

因为你在索引长值 "timestamp":1608166564696, es不会将其转换为源文档中的格式化日期。
但是,如果 timestamp 字段被正确定义为具有类型 date ```
"timestamp": {
"type": "date"
}

然后,在kibana的discover视图中,您将看到格式正确的日期,如以下所示:
![](https://i.stack.imgur.com/kbUgb.png)

相关问题