我已将 Kibana 连接到我的 ES 实例。
cat/indices 返回:
yellow open .kibana 1 1 1 0 3.1kb 3.1kb
yellow open tests 5 1 413042 0 3.4gb 3.4gb
但是我在 kibana 配置屏幕上看到了以下内容。我错过了什么?
更新:
我的示例文档如下所示
"_index": "tests",
"_type": "test7",
"_id": "AVGlIKIM1CQ8BZRgLZVg",
"_score": 1.7840601,
"_source": {
"severity": "ERROR",
"code": "CODE,
"message": "MESSAGE",
"environment": "TEST",
"error_uuid": "cbe99080-0bf3-495c-a417-77384ba0fd39",
"correlation_id": "cf5a1fd5-4fd2-40bb-9cdf-405b91dcbd6f",
"timestamp": "2015-11-20 15:24:39.831"
最佳答案
禁用选项 Use event times to create index names
并放置索引名称而不是模式(tests
)。
当您有基于时间戳的索引名称时,将使用您尝试使用的选项(假设您每天使用 tests-2015.12.01
、 tests-2015.12.02
... 创建一个新索引)。如果您在启用该选项时阅读了消息,那就很清楚了:
Patterns allow you to define dynamic index names. Static text in an index name is denoted using brackets. Example: [logstash-]YYYY.MM.DD. Please note that weeks are setup to use ISO weeks which start on Monday
编辑:时间字段名称中的空下拉列表的问题是因为您的索引映射中没有任何日期类型的字段。您实际上可以检查是否这样做 GET /<index-name>/_mapping?pretty
, 即 timestamp
是“字符串”类型而不是“日期”。发生这种情况是因为格式与 regex for the date detection 不匹配(yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z
)。解决这个问题:
- 您可以更改要插入的时间戳的格式以匹配默认的正则表达式。
- 您可以修改
dynamic_date_format
属性并放置一个与您的时间戳的当前格式匹配的正则表达式。 - 您可以设置一个 index template并为“时间戳”字段设置类型“日期”。
在任何一种情况下,您都需要删除索引并创建一个新索引或重新索引数据。
关于elasticsearch - 如何在 Kibana 中配置索引模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34286917/