Last active
October 28, 2015 17:01
-
-
Save ogarcia/a84ee1ef586f4d2eb9b3 to your computer and use it in GitHub Desktop.
Elasticsearch template for use with nginx logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template": "nginx-*", | |
"settings": { | |
"index.number_of_shards": "5" | |
}, | |
"mappings": { | |
"_default_": { | |
"properties": { | |
"auth": { | |
"index_name": "auth", | |
"index": "not_analyzed", | |
"type": "string" | |
}, | |
"response": { | |
"index_name": "response", | |
"index": "not_analyzed", | |
"ignore_malformed": true, | |
"type": "integer" | |
}, | |
"httpversion": { | |
"index_name": "httpversion", | |
"index": "not_analyzed", | |
"ignore_malformed": true, | |
"type": "float" | |
}, | |
"referrer": { | |
"index_name": "referrer", | |
"index": "not_analyzed", | |
"type": "string" | |
}, | |
"clientdns": { | |
"index_name": "clientdns", | |
"index": "not_analyzed", | |
"type": "string" | |
}, | |
"host": { | |
"index_name": "host", | |
"index": "not_analyzed", | |
"type": "string" | |
}, | |
"bytes": { | |
"index_name": "bytes", | |
"index": "not_analyzed", | |
"ignore_malformed": true, | |
"type": "integer" | |
}, | |
"clientip": { | |
"index_name": "clientip", | |
"index": "not_analyzed", | |
"type": "string" | |
}, | |
"path": { | |
"index_name": "path", | |
"index": "analyzed", | |
"type": "string" | |
}, | |
"geoip": { | |
"type": "object", | |
"dynamic": true, | |
"properties": { | |
"location": { | |
"type": "geo_point" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To put template:
curl -XPUT localhost:9200/_template/nginx -d 'THE_JSON'