Skip to content

Instantly share code, notes, and snippets.

@roopendra
Created November 25, 2016 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roopendra/cec15bd1dd4a596f6197d44d0704e5fd to your computer and use it in GitHub Desktop.
Save roopendra/cec15bd1dd4a596f6197d44d0704e5fd to your computer and use it in GitHub Desktop.
Elasticsearch Template for apache access log parsing. all string fields are not_analyzed except message and text fields.
{
"template": "elk_workshop",
"settings": {
"index.refresh_interval": "5s",
"index.codec": "best_compression",
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"_default_": {
"dynamic_templates": [{
"string_fields": {
"mapping": {
"index": "not_analyzed",
"type": "string",
"doc_values": true
},
"match_mapping_type": "string",
"match": "*"
}
}],
"properties": {
"@version": {
"index": "not_analyzed",
"type": "string"
},
"text": {
"index": "analyzed",
"type": "string"
},
"message": {
"index": "analyzed",
"type": "string"
}
},
"_all": {
"enabled": false
}
}
},
"aliases": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment