Skip to content

Instantly share code, notes, and snippets.

@jworl
Last active September 14, 2017 15:15
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 jworl/d89b6aa8d1958960757059cbdb154daf to your computer and use it in GitHub Desktop.
Save jworl/d89b6aa8d1958960757059cbdb154daf to your computer and use it in GitHub Desktop.
elasticsearch template used by logstash for output
# Create logstash template for pipeline
LOGSTASH_TEMPLATE() {
pipeline=$1
curl -XPUT http://localhost:9200/_template/${pipeline}?pretty -H 'Content-Type: application/json' -d'
{
"order" : 0,
"version" : 50002,
"template" : "${pipeline}-*",
"settings" : {
"index" : {
"number_of_shards": 3,
"number_of_replicas": 1,
"refresh_interval" : "30s"
}
},
"mappings" : {
"stat" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"excluded" : {
"type" : "long"
},
"extracted" : {
"type" : "long"
},
"unknown" : {
"type" : "long"
}
}
}
},
"aliases" : { }
}
'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment