Skip to content

Instantly share code, notes, and snippets.

@jnyryan
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save jnyryan/fb0601d91495c6217b9f to your computer and use it in GitHub Desktop.

Select an option

Save jnyryan/fb0601d91495c6217b9f to your computer and use it in GitHub Desktop.
#!/bin/bash
####################
# Prerequisites
sudo add-apt-repository -y ppa:chris-lea/node.js
# sudo add-apt-repository -y ppa:webupd8team/java # for ORACLE Java
sudo apt-get update
sudo apt-get install -y build-essential libncurses5-dev g++ make
sudo apt-get install -y python-software-properties python git-core htop
####################
# Install java
sudo apt-get -y install openjdk-7-jre-headless # for OPEN Java
# apt-get install -y oracle-java7-installer # for ORACLE Java
java -version
####################
# Installing Elastic Search
sudo wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.2.1.deb
sudo dpkg -i elasticsearch-1.2.1.deb
cd /usr/share/elasticsearch
sudo bin/plugin -install lmenezes/elasticsearch-kopf
cd -
echo Starting ES Service
sudo update-rc.d elasticsearch defaults 95 10
sudo /etc/init.d/elasticsearch start
####################
# Installing Logstash
# https://www.digitalocean.com/community/tutorials/how-to-use-logstash-and-kibana-to-centralize-and-visualize-logs-on-ubuntu-14-04
wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get update
sudo apt-get install logstash=1.4.1-1-bd507eb
#http://logstash.net/docs/1.4.1/tutorials/getting-started-with-logstash
#curl -O https://download.elasticsearch.org/logstash/logstash/logstash-1.4.1.tar.gz
#tar zxvf logstash-1.4.1.tar.gz
input {
stdin {
type => "stdin-type"
}
file {
type => "syslog"
# Wildcards work, here :)
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
}
}
output {
stdout { codec => rubydebug }
elasticsearch { embedded => true }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment