elk中使用自己的动态模版!

我的json路径:/etc/logstash/template/111.json

格式:

{
    "template": "index-name*",
    "settings": {
       "index.number_of_shards": 5,   #分片
       "number_of_replicas": 1,           #备份为1
       "index.refresh_interval": "5s"     #index刷新时间
    },

        "mappings": {
         "message-log": {
          "properties": {

           *                                  ###mapping的模版

        }

     }

  }

}

调用方法:

在logstash的output字段使用:

    template => "/etc/logstash/template/111.json"
    template_overwrite => true

猜你喜欢

转载自blog.csdn.net/weixin_42207486/article/details/82628144