Skip to content

Instantly share code, notes, and snippets.

@colonD
colonD / logstash_daily.sh
Created January 4, 2012 18:00
Quick cron.daily script for stock Logstash/ES installation
#!/bin/sh
# Do elasticsearch optimize on logstash previous day index
# if $1 = all then optimize all indicies
esindex="/opt/elasticsearch/data/elasticsearch/nodes/0/indices"
# Grab yesterday's values
D=`date +%d -d yesterday`
M=`date +%m -d yesterday`
Y=`date +%Y -d yesterday`
@colonD
colonD / logstash.sh
Created September 26, 2011 16:47
Quick fix for logstash slowdowns
#!/bin/sh
MAILTO=root
PID=`ps aux | grep logstash | grep java | grep agent | awk '{print $2}'`
LLEN=`redis-cli LLEN logstash`
LLENMAX="50"
if [ "x$PID" = "x" ]; then
PID=-1