溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

docker efk搭建

發(fā)布時間:2020-07-02 17:17:36 來源:網(wǎng)絡(luò) 閱讀:216 作者:qq5a1d14f340108 欄目:系統(tǒng)運(yùn)維

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

創(chuàng)建目錄
fluentd/conf
在目錄創(chuàng)建文件

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問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI