Last active
May 27, 2017 16:32
-
-
Save kizzx2/71c988cf75088b46d7532a9886f40b02 to your computer and use it in GitHub Desktop.
A docker-compose set up that has nginx -> ELK through RabbitMQ
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 { | |
rabbitmq { | |
host => "rabbitmq" | |
exchange => "logstash" | |
exchange_type => "direct" | |
key => "logstash" | |
durable => true | |
} | |
} |
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
output { | |
elasticsearch { | |
hosts => ["localhost"] | |
manage_template => false | |
index => "logstash-%{+YYYY.MM.dd}" | |
document_type => "%{[@metadata][type]}" | |
} | |
stdout { | |
codec => rubydebug | |
} | |
} |
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
version: '3' | |
services: | |
rabbitmq: | |
image: rabbitmq:alpine | |
ports: | |
- "15672:15672" | |
nginx: | |
image: nginx | |
ports: | |
- "8080:80" | |
labels: | |
- "filebeat.stdin=true" | |
logstash: | |
image: logstash:alpine | |
command: "logstash -f /logstash.conf" | |
volumes: | |
- "./logstash.conf:/logstash.conf:ro" | |
links: | |
- rabbitmq | |
elk: | |
image: sebp/elk | |
volumes: | |
- "./03-rabbitmq-input.conf:/etc/logstash/conf.d/03-rabbitmq-input.conf:ro" | |
- "./30-output.conf:/etc/logstash/conf.d/30-output.conf:ro" | |
ports: | |
- "5601:5601" | |
links: | |
- rabbitmq | |
filebeat: | |
image: willfarrell/filebeat:5-stdin | |
environment: | |
HOSTNAME: "filebeat" | |
LOGSTASH_HOST: "logstash" | |
volumes: | |
- "/var/run/docker.sock:/tmp/docker.sock" | |
- "./filebeat.yml:/etc/filebeat/filebeat.yml:ro" | |
links: | |
- 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
filebeat.prospectors: | |
- input_type: 'stdin' | |
document_type: 'nginx-access' | |
output: | |
console: | |
pretty: true | |
logstash: | |
hosts: ["${LOGSTASH_HOST:logstash}:${LOGSTASH_PORT:5044}"] | |
index: filebeat |
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 { | |
beats { | |
port => 5044 | |
} | |
} | |
output { | |
rabbitmq { | |
host => "rabbitmq" | |
exchange => "logstash" | |
exchange_type => "direct" | |
durable => true | |
key => "logstash" | |
} | |
stdout { | |
codec => rubydebug | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment