iceecream

Logstash 不按日期创建索引

  •  
  •   iceecream · Apr 1, 2020 · 6939 views
    This topic created in 2264 days ago, the information mentioned may be changed or developed.
    输出:
    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 使用带有日期标记的索引?
    3 replies    2020-04-02 10:33:18 +08:00
    DonaldY
        1
    DonaldY  
       Apr 2, 2020
    炸一看,貌似没有问题诶。应该会自动创建 logstash-xxxx.xx.xx
    iceecream
        2
    iceecream  
    OP
       Apr 2, 2020
    @DonaldY 实际上,测试了很多次,还是不会。不知道哪里出问题了。
    iceecream
        3
    iceecream  
    OP
       Apr 2, 2020
    解决方法如下:
    index => "logstash-%{+yyyy.MM.dd}"
    yyyy 要小写。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2681 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 111ms · UTC 02:21 · PVG 10:21 · LAX 19:21 · JFK 22:21
    ♥ Do have faith in what you're doing.