Skip to content

Instantly share code, notes, and snippets.

@rcdexta
Last active November 11, 2016 21:17
Show Gist options
  • Save rcdexta/6e2510b090b434eb55e1 to your computer and use it in GitHub Desktop.
Save rcdexta/6e2510b090b434eb55e1 to your computer and use it in GitHub Desktop.
Elasticsearch Logstash Index Template
curl -XPUT 127.0.0.1:9200/_template/logstash -d '
{
"template" : "logstash*",
"settings" : {
"index.analysis.analyzer.default.type": "standard",
"index.compress.stored": true,
"index.merge.policy.max_merged_segment": "5g",
"index.query.default_field": "@message",
"index.refresh_interval": "2s",
"index.term_index_divisor": 1,
"index.term_index_interval": 128,
"number_of_replicas": 0,
"number_of_shards": 1
},
"mappings": {
"_default_": {
"_all": {
"enabled": false
},
"properties": {
"message": {
"type": "string",
"index": "analyzed"
},
"throwable": {
"type": "string",
"index": "analyzed"
},
"source": {
"type": "string",
"index": "not_analyzed"
},
"x_request_id": {
"type": "string",
"index": "not_analyzed"
},
"properties": {
"properties": {
"x_request_id":{
"type":"string",
"norms":{"enabled":false},
"fields":{
"raw":{
"type":"string",
"index":"not_analyzed",
"ignore_above":256
}
}
}
}
},
"host": {
"type": "string",
"index": "not_analyzed"
},
"tags": {
"type": "string",
"index": "not_analyzed"
},
"@timestamp": {
"type": "date",
"index": "not_analyzed"
},
"type": {
"type": "string",
"index": "not_analyzed"
},
"level": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment