Public Repository

Last pushed: a year ago
Short Description
fluentd v0.12.21 Extended plugin set for kubernetes with graylog2
Full Description

docker-compose.yml example

fluent:
    container_name: web1.example.com.fluentd
    cgroup_parent: web1.example.com
    image: imaghonet/fluentd_extended:v0.12.21
    restart: on-failure:10
    expose:
      - "24224"
    environment:
      FLUENTD_OPT: ""
      FLUENTD_CONF: "fluent.conf"
    volumes:
      - /opt/docker/fluent/fluent.conf:/fluentd/etc/fluent.conf
      - /opt/docker/fluent/conf.d:/fluentd/etc/conf.d
      - /mnt/log/fluentd:/fluentd/log
    ports:
      - 127.0.0.1:24224:24224

  reverse_proxy:
    container_name: web1.example.com.reverse_proxy
    cgroup_parent: web1.example.com
    image: nginx:1.9.3
    depends_on:
      - fluent
    links:
      - some_ui
      - other_ui
    ports:
      # default ip
      - 10.10.10.10:80:80
      - 10.10.10.10:443:443
      # other ip
      - 10.10.10.11:80:81
      - 10.10.10.11:443:444
    volumes:
      - /opt/docker/nginx/nginx.conf:/etc/nginx/nginx.conf
      - /opt/docker/nginx/conf.d:/etc/nginx/conf.d
      - /mnt/certs/reverse_proxy:/etc/nginx/certs
    logging:
      driver: fluentd
      options: 
        fluentd-address: 127.0.0.1:24224
        tag: docker.{{.Name}}

Dockerfile

FROM fluent/fluentd:v0.12.21

LABEL pl.imagho.image.version="1.1" \
      pl.imagho.image.description="fluentd v0.12.21 Extended plugin set for kubernetes with graylog2" \
      pl.imagho.image.os="alpine"

MAINTAINER imaghonet <sysops@imagho.net>

#USER fluent

#WORKDIR /home/fluent

#ENV PATH /home/fluent/.gem/ruby/2.2.0/bin:$PATH

RUN gem install \
        fluent-plugin-secure-forward \
        fluent-plugin-s3 \
        fluent-plugin-rewrite-tag-filter \
        fluent-plugin-conditional_filter \
        fluent-plugin-fields-parser \
        fluent-plugin-filter-record-map \
        fluent-plugin-grep \
        fluent-plugin-kubernetes \
        fluent-plugin-order \
        fluent-plugin-record-modifier \
        gelf

RUN    cd /fluentd/plugins \
    && wget https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb

#EXPOSE 24224

CMD fluentd -c /fluentd/etc/$FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT

fluent.conf

<source>
  @type  forward
  @id    input1
  @label @mainstream
  port  24224
</source>

<filter **>
  @type stdout
</filter>

<label @mainstream>
  <match docker.**>
    @type file
    @id   output_docker1
    path         /fluentd/log/docker.*.log
    symlink_path /fluentd/log/docker.log
    append       true
    time_slice_format %Y%m%d
    time_slice_wait   1m
    time_format       %Y%m%dT%H%M%S%z
  </match>
  <match **>
    @type file
    @id   output1
    path         /fluentd/log/unknown.*.log
    symlink_path /fluentd/log/unknown.log
    append       true
    time_slice_format %Y%m%d
    time_slice_wait   10m
    time_format       %Y%m%dT%H%M%S%z
  </match>
</label>

# Include config files in the ./config.d directory
@include conf.d/*.conf
Docker Pull Command
Owner
imaghonet

Comments (0)