Skip to content

Commit

Permalink
Fixing GEO IP Template Mapping
Browse files Browse the repository at this point in the history
Was missing the https and ignore cert options when putting the template
into elastic search.
  • Loading branch information
Travis Smith committed Jul 12, 2017
1 parent d1bdefb commit 839a519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def install(esServer,esUser,esPass):
shutil.move('logstash/conf/logstash.org','logstash/conf/logstash.conf')

print " Updating Logstash Template for Elasticsearch"
os.popen('curl -u %s:%s -XPUT %s:9201/_template/logstash -d \'{"template":"logstash-*","settings":{"index":{"refresh_interval":"5s"}},"mappings":{"_default_":{"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":{"type":"keyword"}}},"match_mapping_type":"string","match":"*"}}],"_all":{"norms":false,"enabled":true},"properties":{"@timestamp":{"include_in_all":false,"type":"date"},"geoip_dst":{"dynamic":true,"properties":{"ip":{"type":"ip"},"latitude":{"type":"half_float"},"location":{"type":"geo_point"},"longitude":{"type":"half_float"}}},"geoip_src":{"dynamic":true,"properties":{"ip":{"type":"ip"},"latitude":{"type":"half_float"},"location":{"type":"geo_point"},"longitude":{"type":"half_float"}}},"@version":{"include_in_all":false,"type":"keyword"}}}},"aliases":{}}}\'' % (esUser,esPass,esServer)).read()
os.popen('curl -k -u %s:%s -XPUT https://%s:9201/_template/logstash -d \'{"template":"logstash-*","settings":{"index":{"refresh_interval":"5s"}},"mappings":{"_default_":{"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":{"type":"keyword"}}},"match_mapping_type":"string","match":"*"}}],"_all":{"norms":false,"enabled":true},"properties":{"@timestamp":{"include_in_all":false,"type":"date"},"geoip_dst":{"dynamic":true,"properties":{"ip":{"type":"ip"},"latitude":{"type":"half_float"},"location":{"type":"geo_point"},"longitude":{"type":"half_float"}}},"geoip_src":{"dynamic":true,"properties":{"ip":{"type":"ip"},"latitude":{"type":"half_float"},"location":{"type":"geo_point"},"longitude":{"type":"half_float"}}},"@version":{"include_in_all":false,"type":"keyword"}}}},"aliases":{}}}\'' % (esUser,esPass,esServer)).read()
print " Starting Logstash"
os.popen('sudo service logstash start').read()
else:
Expand Down

0 comments on commit 839a519

Please sign in to comment.