码迷,mamicode.com
首页 > 其他好文 > 详细

docker efk搭建

时间:2019-11-07 23:11:43      阅读:96      评论:0      收藏:0      [点我收藏+]

标签:ons   fluent   pos   目录   _for   option   ima   ESS   arc   

docker-compose.yml
version: ‘3.7‘

services:
  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch
    ports:
      - 9200:9200
      - 9300:9300

  fluentd:
    container_name: fluentd
    image: fluent/fluentd
    volumes:
      - ./fluentd/conf:/fluentd/etc
    links:
      - elasticsearch
    ports:
      - 24224:24224
      - 24224:24224/udp

  kibana:
    image: kibana
    links:
      - elasticsearch
    ports:
      - 5601:5601

  nginx:
    image: nginx
    ports:
      - 80:80
    links:
      - fluentd
    logging:
      driver: "fluentd"
      options:
        fluentd-address: localhost:24224
        tag: nginx-access

创建目录
fluentd/conf
在目录创建文件

fluent.conf 注意文件名不可更改

<source>
    @type forward
    port 24224
    bind 0.0.0.0
</source>

<match *.**>
    @type copy
    <store>
        @type elasticsearch
        host elasticsearch
        port 9200
        logstash_format true
        logstash_prefix fluentd
        logstash_dataformat %Y%m%d
        include_tag_key true
        type_name access_log
            type_key @log_name
        flush_interval 1s
    </store>
    <store>
        @type stdout
    </store>
</match>

docker efk搭建

标签:ons   fluent   pos   目录   _for   option   ima   ESS   arc   

原文地址:https://blog.51cto.com/13504746/2448444

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!