-
-
Save mario21ic/b178bc237d7256ea01b4 to your computer and use it in GitHub Desktop.
docker-composeでfluentd + elasticsearch + kibana4 環境をつくる ref: http://qiita.com/cgetc/items/345e3c686910b30ba49f
This file contains hidden or 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
fluentd: | |
build: ./fluentd | |
links: | |
- "elasticsearch" | |
volumes: | |
- /var/lib/docker/containers:/var/lib/docker/containers | |
- /var/run:var/run | |
- /var/log/docker:/var/log/docker | |
elasticsearch: | |
image: elasticsearch | |
expose: | |
- 9200 | |
kibana: | |
image: library/kibana | |
links: | |
- "elasticsearch" | |
ports: | |
- "5601:5601" |
This file contains hidden or 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 kiyoto/fluentd:0.10.56-2.1.1 | |
MAINTAINER [email protected] | |
RUN mkdir /etc/fluent | |
ADD fluent.conf /etc/fluent/ | |
RUN ["apt-get", "update"] | |
RUN ["apt-get", "install", "--yes", "make", "libcurl4-gnutls-dev"] | |
RUN ["/usr/local/bin/gem", "install", "fluent-plugin-elasticsearch", "--no-rdoc", "--no-ri"] | |
RUN ["/usr/local/bin/gem", "install", "fluent-plugin-record-reformer", "--no-rdoc", "--no-ri"] | |
RUN ["/usr/local/bin/gem", "install", "fluent-plugin-docker-tag-resolver", "--no-rdoc", "--no-ri"] | |
ENTRYPOINT ["/usr/local/bin/fluentd", "-c", "/etc/fluent/fluent.conf"] |
This file contains hidden or 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 kiyoto/fluentd:0.10.56-2.1.1 | |
MAINTAINER [email protected] | |
RUN mkdir /etc/fluent | |
ADD fluent.conf /etc/fluent/ | |
RUN ["apt-get", "update"] | |
RUN ["apt-get", "install", "--yes", "make", "libcurl4-gnutls-dev"] | |
RUN ["/usr/local/bin/gem", "install", "fluent-plugin-elasticsearch", "--no-rdoc", "--no-ri"] | |
RUN ["/usr/local/bin/gem", "install", "fluent-plugin-record-reformer", "--no-rdoc", "--no-ri"] | |
RUN ["/usr/local/bin/gem", "install", "fluent-plugin-docker-tag-resolver", "--no-rdoc", "--no-ri"] | |
ENTRYPOINT ["/usr/local/bin/fluentd", "-c", "/etc/fluent/fluent.conf"] |
This file contains hidden or 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-compose up -d |
This file contains hidden or 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
<source> | |
type tail | |
path /var/lib/docker/containers/*/*-json.log | |
pos_file /var/log/fluentd-docker.pos | |
time_format %Y-%m-%dT%H:%M:%S | |
tag docker.log.* | |
format json | |
</source> | |
<match docker.log.**> | |
type docker_tag_resolver | |
</match> | |
<match docker.container.**> | |
type record_reformer | |
container_id ${tag_parts[4]} | |
container_name ${tag_parts[3]} | |
tag docker.all | |
</match> | |
<match docker.all> | |
type elasticsearch | |
log_level debug | |
host elasticsearch | |
port 9200 | |
include_tag_key true | |
logstash_format true | |
flush_interval 5s | |
</match> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment