ELK

38.索引生命周期管理—查询当前的模板

2022-06-27  本文已影响0人  大勇任卷舒

38.1 查询当前的模板

# 查询所有模板
GET /_template/

#查询其中某一个模板
GET /_template/logstash
{
  "logstash" : {
    "order" : 0,
    "version" : 60001,
    "index_patterns" : [
    "logstash-*"
  ],
  "settings" : {
    "index" : {
      "lifecycle" : {
        "name" : "watch-history-ilm-policy"
      },
      "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" : { }
  }
}
PUT /_template/my_template
{
"order" : 0,
"index_patterns" : [
"filebeat_cash-*",
"filebeat_custom-*",
"filebeat_portal-*",
"filebeat_user-*",
"filebeat_hkd-*",
"filebeat_test_custom-*",
"filebeat_test_portal-*",
"filebeat_test_user-*",
"filebeat_test_hkd-*",
"filebeat_test_canal_topic-*"
],
"settings" : {
"index" : {
"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" : { }
}

38.2 index生命周期管理设置

大数据视频推荐:
腾讯课堂
CSDN
ELK入门精讲
AIOps智能运维实战
ELK7 stack开发运维
大数据语音推荐:
ELK7 stack开发运维
企业级大数据技术应用
大数据机器学习案例之推荐系统
自然语言处理
大数据基础
人工智能:深度学习入门到精通

上一篇下一篇

猜你喜欢

热点阅读