Skip to content

Instantly share code, notes, and snippets.

@yosisa
Created April 12, 2014 08:26
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 yosisa/10524595 to your computer and use it in GitHub Desktop.
Save yosisa/10524595 to your computer and use it in GitHub Desktop.
Elasticsearch の index templates で解析方法を指定する(または、default mapping が効かない時に) ref: http://qiita.com/yosisa/items/b0bb44548bbd527005cc
{
"template": "accesslog-*",
"mappings": {
"fluent": {
"properties": {
"host": {
"type": "string",
"index": "not_analyzed"
},
"uri": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
<match pyfluent.**>
type elasticsearch
host localhost
port 9200
logstash_format true
logstash_prefix accesslog
type_name fluent
include_tag_key true
tag_key @tag
flush_interval 5s
</match>
{"host": "127.0.0.1", "uri": "/users/1", "method": "GET", ...}
{
"accesslog": {
"template": "accesslog-*",
"mappings": {
"fluent": {
"properties": {
"host": {
"type": "string",
"index": "not_analyzed"
},
"uri": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment