Last active
December 20, 2015 17:49
-
-
Save osssubb/6171791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######## | |
######## | |
curl -XPUT http://10.0.4.24:9200/_template/logstash -d ' | |
{ | |
"template" : "logstash*", | |
"settings" : { | |
"number_of_shards" : 1, | |
"index.refresh_interval" : "10s", | |
"index.query.default_field": "@message"}, | |
"mappings": { | |
"_default_": { | |
"_all": { "enabled": false }, | |
"_source": { "compress": false }, | |
"properties": { | |
"@message": { "type": "string", "index": "analyzed" }, | |
"@source": { "type": "string", "index": "not_analyzed" }, | |
"@source_host": { "type": "string", "index": "not_analyzed" }, | |
"@source_path": { "type": "string", "index": "not_analyzed" }, | |
"@tags": { "type": "string", "index": "not_analyzed" }, | |
"@timestamp": { "type": "date", "index": "not_analyzed" }, | |
"@type": { "type": "string", "index": "not_analyzed" }, | |
"date": { "type": "date", "format": "MMM dd HH:mm:ss", "index": "not_analyzed" }, | |
"host": { "type": "string", "index": "not_analyzed" }, | |
"service": { "type": "string", "index": "not_analyzed" }, | |
"program": { "type": "string", "index": "not_analyzed" }, | |
"pid": { "type": "integer", "index": "not_analyzed" }, | |
"message": { "type": "string", "index": "analyzed" } | |
} } } }' | |
######## | |
######## | |
PS: For setting custom time format for 'date', I referred to: | |
http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment