Elasticsearch索引无法识别日期Logstash管道

问题描述

我带着对Elasticsearch的怀疑而回来。 我一直在做更多的测试,而我几乎已经完成了有关ELK的学习。 但是我有一点问题。通过创建管道并按如下所示输出elasticsearch集群:

output { 
  
  elasticsearch {
    hosts => [ "IP:9200","IP:9200","IP:9200" ]
    manage_template => false
    index => "example-%{+yyyy.MM.dd}"
  }
}

它没有正确创建日期。我已按照文档中的指示进行操作:https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-index

上面的代码创建索引:example-

相反,如果我通过取消选中字段manage_templateindex保留认值,则会创建格式正确的索引:logstash-2020.08.17-000001

所以我真的不知道我在做什么。如果是文档问题或其他格式错误

一个细节是,我看到了一些2018年的示例,其格式如下:index => "%{[@Metadata][beat]}-%{+YYYY.MM.dd}"。而且,回顾关于elasticsearch输出插件的相同链接意味着创建不同的索引,但我认为它更多地是指根据生产或开发空间来分离索引,而不是根据日期来创建不同的索引。

解决方法

几天后,我注意到我更改了@timestamp字段的默认名称 现在它可以正常工作了。谢谢