Skip to content

Instantly share code, notes, and snippets.

View untergeek's full-sized avatar

Aaron Mildenstein untergeek

View GitHub Profile
@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
@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 / ls-es-mapping.json
Last active December 31, 2015 12:49
Logstash v1.3.2+ Elasticsearch Mapping Template
{
"template" : "logstash-*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
@untergeek
untergeek / fix_logstash-1.3.1_template.sh
Created December 18, 2013 20:49
This script will replace the elasticsearch mapping template named "logstash" (see line 3) and replace it with the below template from v1.3.2, which is currently at https://github.com/logstash/logstash/blob/master/lib/logstash/outputs/elasticsearch/elasticsearch-template.json This template will fix the error LOGSTASH-1711 and the "indexed without…
#!/bin/bash
curl -XDELETE http://localhost:9200/_template/logstash?pretty=true
echo
echo "Deleted current logstash template..."
echo "Creating new logstash template..."
sleep 2
@untergeek
untergeek / event.json
Last active January 1, 2016 16:39
Logstash events...
{
"@version":"1",
"@timestamp":"2013-12-29T15:41:02.123Z",
"host":"host.example.com",
"collectd_type":"df_complex",
"plugin":"df",
"plugin_instance":"Volumes-Time Machine Backups",
"type_instance":"used",
"value":2604146343936.0,
"tags":["collectd"]
#!/bin/bash
#
#
# Usage
# This script do nothing, it juste show files that are scanned or not by
# Logstash and plugin File. 3 outputs
#
# ./utilSinceDB.sh
# ./utilSinceDB.sh | grep "not found in sincedb"
# ./utilSinceDB.sh | grep "to delete"
indices.memory.index_buffer_size: 15%
cluster.name: untergeek
node.name: "NotSony"
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.timeout: 10s

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@untergeek
untergeek / logstash_irc.conf
Created May 2, 2014 17:47
Logstash IRC input for #logstash
input {
irc {
channels => [ "#logstash" ]
host => "irc.freenode.org"
nick => "arbitrary_bot_name"
port => 6667
type => "irc"
}
}
@untergeek
untergeek / logstash-1-collectd.conf
Created May 7, 2014 15:48
Logstash 1.4.1+ Collectd configuration
# This is the simplest definition, with the addition of a type
input {
udp {
port => 25826 # Must be specified. 25826 is the default for collectd
buffer_size => 1452 # Should be specified. 1452 is the default for recent versions of collectd
codec => collectd { } # This will invoke the default options for the codec
type => "collectd"
}
}