From 3ec0498098942ae47079f2ad397af41235ad5b4a Mon Sep 17 00:00:00 2001 From: Aleksander Cynarski Date: Fri, 30 Nov 2018 17:18:29 +0100 Subject: [PATCH] Init elastic --- docker-compose.yml | 14 ++++++++++++++ fluentd/Dockerfile | 2 +- fluentd/conf/fluent.conf | 11 +++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 38d4ec5..0a13b6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,6 +65,20 @@ services: INFLUXDB_REPORTING_DISABLED: 'false' SERVICE_8086_NAME: 'influxdb' + elasticsearch: + image: elasticsearch:6.5.1 + expose: + - 9200 + ports: + - "9200:9200" + + kibana: + image: kibana:6.5.1 + links: + - "elasticsearch" + ports: + - "5601:5601" + volumes: portainer_data: diff --git a/fluentd/Dockerfile b/fluentd/Dockerfile index 1446d54..3891503 100644 --- a/fluentd/Dockerfile +++ b/fluentd/Dockerfile @@ -1,3 +1,3 @@ FROM fluent/fluentd:latest -RUN ["gem", "install", "fluent-plugin-influxdb", "--no-rdoc", "--no-ri"] +RUN ["gem", "install", "fluent-plugin-elasticsearch", "--no-rdoc", "--no-ri"] diff --git a/fluentd/conf/fluent.conf b/fluentd/conf/fluent.conf index 4f268d8..b307c90 100644 --- a/fluentd/conf/fluent.conf +++ b/fluentd/conf/fluent.conf @@ -7,10 +7,13 @@ @type copy - @type influxdb - host influxdb_elena - dbname logging - port 8086 + @type elasticsearch + host elastic_elena + logstash_format true + logstash_prefix fluentd + logstash_dateformat %Y%m%d + include_tag_key true + type_name access_log tag_key @log_name flush_interval 1s