Last active
August 29, 2015 14:17
-
-
Save loz/74a39b882987b37434df to your computer and use it in GitHub Desktop.
Docker ELK
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
docker run -d -p 9200:9200 \ | |
--name elasticsearch \ | |
-p 9300:9300 \ | |
-v /data:/data dockerfile/elasticsearch \ | |
/elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml | |
docker run --name kibana \ | |
-d -p 8080:8080 \ | |
--link elasticsearch:docker.mrloz.xyz \ | |
clusterhq/kibana | |
docker run --name nginx \ | |
-p 80:80 \ | |
-v /data/www:/usr/share/nginx/html:ro \ | |
-v /data/nginx.conf:/etc/nginx/nginx.conf \ | |
-v /data/log:/var/log \ | |
-d nginx | |
docker run --name logstash \ | |
--link=elasticsearch:elasticsearch \ | |
-v /data/log:/var/host_logs \ | |
-v /data/nginx-logstash.conf:/etc/confd/templates/logstash.conf.tmpl:ro \ | |
-d digitalwonderland/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
input { | |
file { | |
sincedb_path => "/nginx.since" | |
path => "/var/host_logs/nginx/access.json" | |
codec => "json" | |
add_field => { | |
facility => "nginx" | |
} | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
elasticsearch_http { | |
host => "{{getv "/elasticsearch/port/9200/tcp/addr"}}" | |
port => "{{getv "/elasticsearch/port/9200/tcp/port"}}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment