Giter Club home page Giter Club logo

docker-fluentd's Introduction

docker-fluentd Build Status

ViaQ Fluentd docker container - can be used as either a local collector, or as an aggregator/formatter/normalizer, for feeding data into Elasticsearch.

Environmental variables:

Elasticsearch output

  • ENABLE_ES - use Elasticsearch for output. Defaults to true
  • LOGSTASH_PREFIX - Elasticsearch index name prefix. Defaults to viaq
  • ES_HOST must be FQDN of ElasticSearch server. Defaults to viaq-elasticsearch.
  • ES_PORT must be the port on which the ElasticSearch server is listening. Defaults to 9200.

Syslog input

  • ENABLE_SYSLOG - use syslog (RFC5424) listener for tcp/udp input. Defaults to true.
  • SYSLOG_LISTEN_PORT the port this rsyslog instance is listening for. both TCP and UDP. Defaults to 10514.
  • SYSLOG_LISTEN_BIND_ADDR - ip address to bind to. Defaults to 0.0.0.0
  • FLUENTD_SYSLOG_LOG_LEVEL - default is FLUENTD_LOG_LEVEL or warn

Forwarder input

  • ENABLE_FORWARD - use fluentd forwarder listener (e.g. for fluent-cat) for tcp/udp input. Defaults to true.
  • FLUENTD_FORWARD_INPUT_PORT - default is 24224
  • FLUENTD_FORWARD_INPUT_BIND_ADDR - default is 0.0.0.0
  • FLUENTD_FORWARD_INPUT_LOG_LEVEL - default is FLUENTD_LOG_LEVEL or warn

Journal input

  • ENABLE_JOURNAL - read from systemd journal - default false
  • JOURNAL_DIR - default is /run/log
  • FLUENTD_JOURNAL_LOG_LEVEL - default is FLUENTD_LOG_LEVEL or warn

Tail/file input

  • ENABLE_TAIL - default is false
  • FLUENTD_TAIL_LOG_DIR - default /var/log - reads the file(s) messages* in that dir
  • FLUENTD_TAIL_LOG_LEVEL - default is FLUENTD_LOG_LEVEL or warn

AMQP input

  • ENABLE_AMQP_INPUT - read from AMQP queue - default true
  • FLUENTD_AMQP_INPUT_URL - default is amqp://viaq-qpid-router:5672/viaq
  • FLUENTD_AMQP_INPUT_LOG_LEVEL - default is FLUENTD_LOG_LEVEL or warn

Stdout output (for debugging)

  • ENABLE_STDOUT - default false

Monitor http://docs.fluentd.org/articles/monitoring

  • ENABLE_MONITOR - Defaults to true.
  • MONITOR_PORT - default is 24220
  • MONITOR_BIND_ADDR - default is 0.0.0.0

Debug http://docs.fluentd.org/articles/monitoring

  • ENABLE_DEBUG - Defaults to false.
  • DEBUG_PORT - default is 24230
  • DEBUG_BIND_ADDR - default is 127.0.0.1

If you want to use fluentd with or as a normalizer, you must define the following:

  • NORMALIZER_NAME - The string name of the normalize reported in the ES record as "pipeline_metadata":{"normalizer":{"name": "NORMALIZER_NAME"}}. This is a descriptive string used for searching and filtering.
  • NORMALIZER_IP - not currently used
  • NORMALIZER_HOSTNAME - hostname of the normalizer node/machine. This is reported in the ES record as "pipeline_metadata":{"normalizer":{"hostname": "NORMALIZER_HOSTNAME"}}.

Ruby version

  • RUBY_SCL_VER - Is used to specify Ruby version from software collection. Currently supports rh-ruby22. By default Ruby from base Docker image is used (i.e. centos7 comes with Ruby 2.0.0p598).

External Fluentd config

In order to add own Fluentd configuration file please add the configuration files to a local directory and map in to /data docker volume. The following files are taken form the local directory: fluent.conf, config.d/*, patterns.d/* In case fluent.conf exists, the default config.d/*.conf is removed and not used in the container.

Running:

Using plain docker, default arguments:

# docker run -d -p 10514:10514/udp -p 24224:24224/udp -p 24220:24220 \
  -e FLUENTD_LOG_LEVEL=info --name viaq-fluentd viaq/fluentd

Use Ruby 2.2 from software collection:

# docker run -d -e RUBY_SCL_VER=rh-ruby22 ... --name viaq-fluentd viaq/fluentd

Using specified syslog listen host, fluentd config dir, normalizer configuration:

# docker run -d -p $syslog_listen_port:$syslog_listen_port/tcp \
  -p $syslog_listen_port:$syslog_listen_port/udp -v $local_dir:/data \
  -u $uid -e ES_HOST=$elasticsearchhost -e ES_PORT=$port \
  -e SYSLOG_LISTEN_PORT=$syslog_listen_port \
  -e NORMALIZER_NAME=container-rsyslog8.17 -e NORMALIZER_IP=$normalizer_ip \
  -e LOGSTASH_PREFIX=v2016.03.10.0-viaq --name viaq-fluentd viaq/docker-fluentd

docker-fluentd's People

Contributors

alanconway avatar isimluk avatar lukas-vlcek avatar richm avatar t0ffel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-fluentd's Issues

Ruby version error on building Docker image

When building Docker image I am getting the following errors:

ERROR:  Error installing fluentd:
    fluentd requires Ruby version >= 2.1.
ERROR:  Error installing fluent-plugin-elasticsearch:
    fluentd requires Ruby version >= 2.1.

I think the problem is that new [stable] version of fluentd 0.14.0 has been released yesterday and it requires Ruby >= 2.1 while we have Ruby 2.0 in base CentOS image. The Docker file just executes gem install fluentd which grabs the latest stable version. We probably need to specify versions as well.

Failing start of the docker container

Lukass-MacBook-Pro:docker-fluentd lvlcek$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS               NAMES
9bf1fdd09480        19b97c4fc6d7        "/bin/sh -c /usr/sbin"   5 minutes ago       Exited (1) 5 minutes ago                       suspicious_pasteur

I am trying to start this container on my Mac using docker-machine (but using Mac and docker-machine should not make any difference IMO). I will investigate further, just in case anybody has any idea what might be wrong...

Lukass-MacBook-Pro:docker-fluentd lvlcek$ docker logs --tail 200 9bf1fdd09480a56d2ae4869d2755b9774f30b7e040ecb815d0dbedd0c854477e
+ ES_HOST=viaq-elasticsearch
+ ES_PORT=9200
+ SYSLOG_LISTEN_PORT=10514
+ DEBUG_FLUENTD=false
+ LOGSTASH_PREFIX=v2016.03.10.0-viaq
+ '[' false = true ']'
+ FLUENTD_ARGS=
+ '[' -f /data/fluent.conf ']'
+ for file in /etc/fluent/fluent.conf '/etc/fluent/config.d/*.conf' '/etc/fluent/config.d/**/*.conf'
+ '[' '!' -f /etc/fluent/fluent.conf ']'
+ continue
+ for file in /etc/fluent/fluent.conf '/etc/fluent/config.d/*.conf' '/etc/fluent/config.d/**/*.conf'
+ '[' '!' -f '/etc/fluent/config.d/*.conf' ']'
+ continue
+ for file in /etc/fluent/fluent.conf '/etc/fluent/config.d/*.conf' '/etc/fluent/config.d/**/*.conf'
+ '[' '!' -f '/etc/fluent/config.d/**/*.conf' ']'
+ continue
+ fluentd
2016-06-06 12:36:42 +0000 [info]: reading config file path="/etc/fluent/fluent.conf"
/opt/app-root/src/gems/fluentd-0.12.26/lib/fluent/supervisor.rb:474:in `read': No such file or directory - /etc/fluent/fluent.conf (Errno::ENOENT)
    from /opt/app-root/src/gems/fluentd-0.12.26/lib/fluent/supervisor.rb:474:in `read_config'
    from /opt/app-root/src/gems/fluentd-0.12.26/lib/fluent/supervisor.rb:144:in `start'
    from /opt/app-root/src/gems/fluentd-0.12.26/lib/fluent/command/fluentd.rb:173:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /opt/app-root/src/gems/fluentd-0.12.26/bin/fluentd:5:in `<top (required)>'
    from /opt/app-root/src/bin/fluentd:23:in `load'
    from /opt/app-root/src/bin/fluentd:23:in `<main>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.