From 6c7b7238cb5ab312f935dfccedc16b92153b62df Mon Sep 17 00:00:00 2001 From: Steve Mokris Date: Wed, 4 Jul 2018 20:39:18 -0400 Subject: [PATCH] In the default templates, specify geoip.postal_code to be type 'keyword', to avoid incorrectly autodetecting as type 'date'. --- .../outputs/elasticsearch/elasticsearch-template-es2x.json | 3 ++- .../outputs/elasticsearch/elasticsearch-template-es5x.json | 3 ++- .../outputs/elasticsearch/elasticsearch-template-es6x.json | 3 ++- .../outputs/elasticsearch/elasticsearch-template-es7x.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es2x.json b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es2x.json index 00782e048..f3c577ce0 100644 --- a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es2x.json +++ b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es2x.json @@ -86,7 +86,8 @@ "ip": { "type": "ip", "doc_values" : true }, "location" : { "type" : "geo_point", "doc_values" : true }, "latitude" : { "type" : "float", "doc_values" : true }, - "longitude" : { "type" : "float", "doc_values" : true } + "longitude" : { "type" : "float", "doc_values" : true }, + "postal_code" : { "type" : "string", "index" : "not_analyzed" } } } } diff --git a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es5x.json b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es5x.json index c758a3088..2565946a5 100644 --- a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es5x.json +++ b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es5x.json @@ -37,7 +37,8 @@ "ip": { "type": "ip" }, "location" : { "type" : "geo_point" }, "latitude" : { "type" : "half_float" }, - "longitude" : { "type" : "half_float" } + "longitude" : { "type" : "half_float" }, + "postal_code" : { "type" : "keyword" } } } } diff --git a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es6x.json b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es6x.json index 2227906eb..7614ba850 100644 --- a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es6x.json +++ b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es6x.json @@ -36,7 +36,8 @@ "ip": { "type": "ip" }, "location" : { "type" : "geo_point" }, "latitude" : { "type" : "half_float" }, - "longitude" : { "type" : "half_float" } + "longitude" : { "type" : "half_float" }, + "postal_code" : { "type" : "keyword" } } } } diff --git a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es7x.json b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es7x.json index c41dc0df8..e62dbb189 100644 --- a/lib/logstash/outputs/elasticsearch/elasticsearch-template-es7x.json +++ b/lib/logstash/outputs/elasticsearch/elasticsearch-template-es7x.json @@ -37,7 +37,8 @@ "ip": { "type": "ip" }, "location" : { "type" : "geo_point" }, "latitude" : { "type" : "half_float" }, - "longitude" : { "type" : "half_float" } + "longitude" : { "type" : "half_float" }, + "postal_code" : { "type" : "keyword" } } } }