Skip to content

Instantly share code, notes, and snippets.

View untergeek's full-sized avatar

Aaron Mildenstein untergeek

View GitHub Profile
@untergeek
untergeek / ls-es-mapping.json
Last active March 16, 2019 12:38
Logstash v1.2+ Elasticsearch Mapping Template
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
@untergeek
untergeek / segment_count.sh
Created September 16, 2012 13:42
Segment count per index
for index in $(ls /data/ES/elasticsearch/nodes/0/indices/); do echo -n "$index " ; curl -s -XGET "http://localhost:9200/$index/_segments?pretty=true" | grep committed_segments | awk -F: '{print $2}' | awk -F, '{sum += $1}; END {print sum}' | tail -1; done