Last active
August 29, 2015 14:12
-
-
Save yonatang/72a309d87c64aa4ef162 to your computer and use it in GitHub Desktop.
docker - logstash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM dockerfile/java:oracle-java7 | |
ENV KB_PKG_NAME kibana-4.0.0-beta3 | |
RUN \ | |
cd / && \ | |
wget https://download.elasticsearch.org/kibana/kibana/$KB_PKG_NAME.tar.gz && \ | |
tar xvzf $KB_PKG_NAME.tar.gz && \ | |
rm -f $KB_PKG_NAME.tar.gz && \ | |
mv /$KB_PKG_NAME /kibana | |
#ADD config/kibana.yml /kibana/config/kibana.yml | |
RUN \ | |
sed -i "s/elasticsearch:.*/elasticsearch: http:\/\/`curl http://169.254.169.254/latest/meta-data/local-ipv4`:9200/" /kibana/config/kibana.yml | |
CMD ["/kibana/bin/kibana"] | |
EXPOSE 5601 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
log4j { | |
port => "4560" | |
type => "log4j" | |
} | |
syslog { | |
port => "5514" | |
type => "syslog" | |
} | |
tcp { | |
charset => "UTF-8" | |
format => "json" | |
port => "28777" | |
type => "nodejs" | |
} | |
} | |
filter { | |
if [program] == "apache-access" { | |
grok { | |
match => [ "message", "%{IPORHOST:clientip} \((%{IP:XF} *)+\) %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] \"(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})\" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent}" ] | |
} | |
} | |
if [program] == "tomcat-access" { | |
grok { | |
match => [ "message", "%{COMMONAPACHELOG}" ] | |
} | |
} | |
} | |
output { | |
elasticsearch_http { | |
host => "ES_HOST" | |
port => "ES_PORT" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To set up elasicsearch, use
docker docker run -d -p 9200:9200 -p 9300:9300 --name es dockerfile/elasticsearch