zoukankan      html  css  js  c++  java
  • ES索引模板——就是在新建索引时候指定的正则匹配来设置mapping而已,对于自动扩容有用

    索引模板

     扩容设计 » 索引模板

    Elasticsearch 不要求你在使用一个索引前创建它。 对于日志记录类应用,依赖于自动创建索引比手动创建要更加方便。

    Logstash 使用事件中的时间戳来生成索引名。 默认每天被索引至不同的索引中,因此一个 @timestamp 为 2014-10-01 00:00:01 的事件将被发送至索引 logstash-2014.10.01 中。 如果那个索引不存在,它将被自动创建。

    通常我们想要控制一些新建索引的设置(settings)和映射(mappings)。也许我们想要限制分片数为 1,并且禁用 _all 域。 索引模板可以用于控制何种设置(settings)应当被应用于新创建的索引:

    PUT /_template/my_logs 
    {
      "template": "logstash-*", 
      "order":    1, 
      "settings": {
        "number_of_shards": 1 
      },
      "mappings": {
        "_default_": { 
          "_all": {
            "enabled": false
          }
        }
      },
      "aliases": {
        "last_3_months": {} 
      }
    }

    创建一个名为 my_logs 的模板。

    将这个

  • 相关阅读:
    HTTP解决了什么问题?
    OSI模型--TCP/IP
    USB取证工具-Usbrip
    ModSecurity OWASP 规则集说明
    WAF简介及ModSecurity-nginx搭建
    aSYNcrone-ddos
    Centos7安装php7.1
    Centos7基于LNMP架构搭建DVWA
    web扫描器-uniscan
    基于腾讯云搭建宝塔面板
  • 原文地址:https://www.cnblogs.com/bonelee/p/7837282.html
Copyright © 2011-2022 走看看