zoukankan      html  css  js  c++  java
  • index lifecycle 索引生命周期管理

    1.首先设置一个lifecycle policies

    2.创建索引模板,在模板中绑定生命周期

    PUT _template/logstash-tx
    {
        "order" : 10,
        "version" : 60001,
        "index_patterns" : [
          "logstash-*"
        ],
        "settings" : {
          "index" : {
            "lifecycle" : {
              "name" : "logstash-tx"
            },
            "number_of_shards" : "1",
            "refresh_interval" : "5s"
          }
        },
        "mappings" : {
          "dynamic_templates" : [
            {
              "message_field" : {
                "path_match" : "message",
                "mapping" : {
                  "norms" : false,
                  "type" : "text"
                },
                "match_mapping_type" : "string"
              }
            },
            {
              "string_fields" : {
                "mapping" : {
                  "norms" : false,
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "ignore_above" : 256,
                      "type" : "keyword"
                    }
                  }
                },
                "match_mapping_type" : "string",
                "match" : "*"
              }
            }
          ],
          "properties" : {
            "@timestamp" : {
              "type" : "date"
            },
            "geoip" : {
              "dynamic" : true,
              "properties" : {
                "ip" : {
                  "type" : "ip"
                },
                "latitude" : {
                  "type" : "half_float"
                },
                "location" : {
                  "type" : "geo_point"
                },
                "longitude" : {
                  "type" : "half_float"
                }
              }
            },
            "@version" : {
              "type" : "keyword"
            }
          }
        },
        "aliases" : { }
      }
    

    3.新建index并查看是否成功引用生命周期

  • 相关阅读:
    20201224-3
    20201224-3 列表的使用1
    20201224 字符串常用操作
    20201224-1
    20201223-1 俄罗斯方块
    3月27日:毕业设计计划
    3月26日:毕业设计计划
    3月25日:毕业设计计划
    3月24日:毕业设计计划
    3月23日:毕业设计计划
  • 原文地址:https://www.cnblogs.com/czalinux/p/14239735.html
Copyright © 2011-2022 走看看