Skip to content

Instantly share code, notes, and snippets.

@darklow
Created May 20, 2012 10:16
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 darklow/2757570 to your computer and use it in GitHub Desktop.
Save darklow/2757570 to your computer and use it in GitHub Desktop.
Elasticsearch log mapping
// Index config
{
"number_of_shards": 5,
"number_of_replicas": 1,
"analysis": {
"analyzer": {
"log_analyzer": {
"type": "custom",
"tokenizer": "pattern",
"filter": [
"lowercase"
]
}
}
}
}
// Mapping
{
"_all": {
"enabled": false
},
"index_analyzer": "log_analyzer",
"search_analyzer": "log_analyzer",
"properties": {
"uid": {
"type": "integer"
},
"time": {
"store": "yes", // Not sure about this
"type": "integer"
},
"date": {
"type": "date"
},
"title": {
"type": "string"
},
"ip": {
"index": "not_analyzed",
"type": "string"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment