Logstash 不按日期创建索引

2020-04-01 19:43:03 +08:00
 iceecream
输出:
output {
elasticsearch {
hosts => ["localhost"]
index => "logstash-%{+YYYY.MM.dd}"
}
}
索引模板:
{
"logstash" : {
"order" : 0,
"index_patterns" : [
"logstash-*"
],
"settings" : {
"index" : {
"number_of_shards" : "1"
}
},
"mappings" : { },
"aliases" : { }
}

在 ES7.2 中,创建的是 logstash 索引,而不是 logstash-2020.xx.xx 这种索引。求大佬指点一下,如何才能再次回到如何获取 Logstash 使用带有日期标记的索引?
2920 次点击
所在节点    Elasticsearch
3 条回复
DonaldY
2020-04-02 01:28:35 +08:00
炸一看,貌似没有问题诶。应该会自动创建 logstash-xxxx.xx.xx
iceecream
2020-04-02 10:10:15 +08:00
@DonaldY 实际上,测试了很多次,还是不会。不知道哪里出问题了。
iceecream
2020-04-02 10:33:18 +08:00
解决方法如下:
index => "logstash-%{+yyyy.MM.dd}"
yyyy 要小写。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/658424

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX