ES 새 템 플 릿 추가

3836 단어 ELK
curl -XPUT elastic:[email protected]:9200/_template/nginx -d '
{
    "template" : "nginx*",
    "order": 0, 
    "index_patterns": [
      "nginx*" 
    ], 
    "settings" : {
      "refresh_interval": "30s",
      "merge.policy.max_merged_segment": "1000mb",
      "translog.durability": "async",
      "translog.flush_threshold_size": "2gb",
      "translog.sync_interval": "100s",
      "index" : {
        "number_of_shards" : "11",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : {
      "_default_" : {
        "_all" : {
          "enabled" : true,
          "norms" : false
        },
        "dynamic_templates" : [
          {
            "message_field" : {
              "path_match" : "message",
              "match_mapping_type" : "string",
              "mapping" : {
                "type" : "text",
                "norms" : false
              }
            }
          },
          {
            "string_fields" : {
              "match" : "*",
              "match_mapping_type" : "string",
              "mapping" : {
                "type" : "text",
                "norms" : false,
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 1024
                  }
                }
              }
            }
          }
        ],
        "properties": {
          "@timestamp": {
            "type": "date"
          },
          "@version": {
            "type": "keyword"
          },
          "url_args": {
            "type": "nested",
            "properties": {
              "key": {
                "type": "keyword"
              },
              "value": {
                "type": "keyword"
              }
            }
          }
      }
      }
    }
}

 es        ,          

        test    
curl -XGET http://elastic:[email protected]:9200/_cat/templates

template_1              zhouls*                  0          
test                    logstash-*               0          50001
logstash                logstash-*               0          50001
.ml-anomalies-          .ml-anomalies-*          0          5060899
.ml-notifications       .ml-notifications        0          5060899
.monitoring-alerts      .monitoring-alerts-6     0          5050099
.ml-meta                .ml-meta                 0          5060899
template_2              test*                    0          
triggered_watches       .triggered_watches*      2147483647 
.ml-state               .ml-state                0          5060899
security_audit_log      .security_audit_log*     2147483647 
.monitoring-logstash    .monitoring-logstash-6-* 0          5050099
security-index-template .security                1000       
watches                 .watches*                2147483647 
.monitoring-kibana      .monitoring-kibana-6-*   0          5050099
.monitoring-es          .monitoring-es-6-*       0          5050099
.watch-history-6        .watcher-history-6*      2147483647 


  test    
curl -XGET http://elastic:[email protected]:9200/_template/test


  :  (1)  template_2      test     。
    (2)     template_2,   test*。
  
  
    
    
curl -XDELETE http://elastic:[email protected]:9200/_template/template_1

좋은 웹페이지 즐겨찾기