Skip to content

Instantly share code, notes, and snippets.

@martinhynar
Created February 8, 2016 09:49
Show Gist options
  • Save martinhynar/5a77a2cdbd67d837ab80 to your computer and use it in GitHub Desktop.
Save martinhynar/5a77a2cdbd67d837ab80 to your computer and use it in GitHub Desktop.
dynamic mapping to discard temporary fields after logstash processing
{
"mappings": {
"logs": {
"dynamic": "false",
"_source": {
"excludes": [
"*_"
]
},
"properties": {
"title": {
"type": "string"
},
"str": {
"type": "string",
"index": "not_analyzed",
"doc_values": true,
"fields": {
"analyzed": {
"type": "string",
"index": "analyzed"
}
}
}
},
"dynamic_templates": [
{
"discard": {
"match": "*_",
"mapping": {
"index": "no"
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment