BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/230250

Change subject: logstash: Enable doc_values in template mapping
......................................................................

logstash: Enable doc_values in template mapping

Add '"doc_values": true' to numeric, boolean, geo-point and not_analyzed
strings in the template mapping for new Elasticsearch logstash-*
indices.

Doc values reduce runtime heap consumption for fielddata usage by
creating pre-computed on-disk structures. We were doing this dynamic raw
strings previously but the configuration syntax has changed and upstream
Elasticsearch is not recommending this for all applicable field types.
The next major version (2.0) of Elasticsearch will use doc_values by
default.

Changing this in Puppet is just a bookkeeping and new Elasticsearch
cluster feature. Existing clusters will need to have their mappings
updated manually via HTTP PUT to /_template/logstash to replace the
current index template.

This template has already been applied to the production and beta
logstash clusters.

Ref: 
<https://www.elastic.co/guide/en/elasticsearch/guide/current/doc-values.html>
Change-Id: Ie8cf588f7a0a9ebdb1ba0ca337e1cf934065b3e9
---
M files/logstash/elasticsearch-template.json
1 file changed, 45 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/50/230250/1

diff --git a/files/logstash/elasticsearch-template.json 
b/files/logstash/elasticsearch-template.json
index 91fff22..a29c3f5 100644
--- a/files/logstash/elasticsearch-template.json
+++ b/files/logstash/elasticsearch-template.json
@@ -16,7 +16,10 @@
   },
   "mappings" : {
     "_default_" : {
-      "_all" : {"enabled" : true},
+      "_all" : {
+        "enabled" : true,
+        "omit_norms": true
+      },
       "dynamic_templates" : [ {
         "string_fields" : {
           "match" : "*",
@@ -32,22 +35,40 @@
               "raw" : {
                 "type" : "string",
                 "index" : "not_analyzed",
-                "ignore_above" : 256
+                "ignore_above" : 256,
+                "doc_values": true
               }
             }
           }
         }
       } ],
       "properties" : {
-        "@timestamp" : { "type" : "date", "index" : "not_analyzed" },
-        "@version" : { "type" : "string", "index" : "not_analyzed" },
+        "@timestamp" : {
+          "type" : "date",
+          "index" : "not_analyzed",
+          "doc_values": true
+        },
+        "@version" : {
+          "type" : "string",
+          "index" : "not_analyzed",
+          "doc_values": true
+        },
         "geoip"  : {
           "type" : "object",
           "dynamic" : true,
           "path" : "full",
-          "properties" : { "location" : { "type" : "geo_point" } }
+          "properties" : {
+            "location" : {
+              "type" : "geo_point",
+              "doc_values": true
+            }
+          }
         },
-        "host" : { "type" : "string", "index" : "not_analyzed" },
+        "host" : {
+          "type" : "string",
+          "index" : "not_analyzed",
+          "doc_values": true
+        },
         "message" : {
           "type" : "string",
           "index" : "analyzed",
@@ -58,8 +79,8 @@
           "fields": {
             "raw": {
               "type": "string",
-              "index": "no",
-              "fielddata": { "format": "doc_values" }
+              "index": "not_analyzed",
+              "doc_values": true
             },
             "normalized_message": {
               "index" : "analyzed",
@@ -68,14 +89,26 @@
             }
           }
         },
-        "sequence_id" : { "type": "long" },
+        "sequence_id" : {
+          "type": "long",
+          "doc_values": true
+        },
         "tags" : {
           "type" : "string",
           "index" : "not_analyzed",
-          "index_name" : "tag"
+          "index_name" : "tag",
+          "doc_values": true
         },
-        "type" : { "type" : "string", "index" : "not_analyzed" },
-        "udp_sender" : { "type" : "string", "index" : "not_analyzed" }
+        "type" : {
+          "type" : "string",
+          "index" : "not_analyzed",
+          "doc_values": true
+        },
+        "udp_sender" : {
+          "type" : "string",
+          "index" : "not_analyzed",
+          "doc_values": true
+        }
       }
     }
   }

-- 
To view, visit https://gerrit.wikimedia.org/r/230250
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8cf588f7a0a9ebdb1ba0ca337e1cf934065b3e9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to