Skip to content

Instantly share code, notes, and snippets.

@hidepin
Created October 25, 2015 06:58
Show Gist options
  • Save hidepin/873d84d86dcc9c2c0f9a to your computer and use it in GitHub Desktop.
Save hidepin/873d84d86dcc9c2c0f9a to your computer and use it in GitHub Desktop.
elasticsearchのテンプレート
{
"template" : "apache_log*",
"mappings" : {
"www3" : {
"properties" : {
"remote-host" : {
"type" : "string"
},
"request-header-Referer" : {
"type" : "string"
},
"request-header-User-Agent" : {
"type" : "multi_field",
"fields" : {
"request-header-User-Agent" : { "type" : "string", "index": "analyzed" },
"full" : { "type" : "string", "index": "not_analyzed" }
}
},
"request-line" : {
"type" : "string"
},
"request-process-time-us" : {
"type" : "long"
},
"request-time" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"response-status" : {
"type" : "long"
},
"response-total-bytes" : {
"type" : "long"
}
}
}
}
}
}
@hidepin
Copy link
Author

hidepin commented Oct 26, 2015

curl -XPUT http://192.168.0.56:9200/apache_log -d @multi.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment