温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

docker efk搭建

发布时间:2020-07-02 17:17:36 来源:网络 阅读:202 作者:qq5a1d14f340108 栏目:系统运维

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>
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI