Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2012 13:59
Show Gist options
  • Save anonymous/4318467 to your computer and use it in GitHub Desktop.
Save anonymous/4318467 to your computer and use it in GitHub Desktop.
ElasticSearch configuration for LogStash
cluster:
name: elasticsearch
network:
host: 127.0.0.1
path:
logs: /var/log/elasticsearch
data: /var/lib/elasticsearch
conf: /etc/elasticsearch
* Set `path.conf` to the place where you keep your ES configuration (for example /etc/elasticsearch)
* `mkdir templates` in `path.conf`
* put the json in your templates dir
{
"template" : "logstash*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index.cache.field.type" : "soft",
"index.refresh_interval" : "5s",
"index.store.compress.stored" : true,
"index.store.compress.tv" : true,
"index.query.default_field" : "@message",
"index.routing.allocation.total_shards_per_node" : 2
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : false},
"_source": { "compress": true },
"properties" : {
"@fields" : {
"type" : "object",
"dynamic": true,
"path": "full",
"properties" : {
"clientip" : { "type": "ip"}
}
},
"@message": { "type": "string", "index": "analyzed" },
"@source": { "type": "string", "index": "not_analyzed" },
"@source_host": { "type": "string", "index": "not_analyzed" },
"@source_path": { "type": "string", "index": "not_analyzed" },
"@tags": { "type": "string", "index": "not_analyzed" },
"@timestamp": { "type": "date", "index": "not_analyzed" },
"@type": { "type": "string", "index": "not_analyzed" }
}
}
}
}
@cnf
Copy link

cnf commented Dec 17, 2012

Damn, forgot to log in to paste this...

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