Skip to content

Instantly share code, notes, and snippets.

@harabchuk
Last active January 15, 2021 18:00
Show Gist options
  • Save harabchuk/abd53d1e80168e2d94f58eb0f75aa4f7 to your computer and use it in GitHub Desktop.
Save harabchuk/abd53d1e80168e2d94f58eb0f75aa4f7 to your computer and use it in GitHub Desktop.
Fluentd GELF forwarder
#!/bin/bash
docker build -t fluentd-gelf-forwarder .
FROM fluent/fluentd:v1.12-debian-1
LABEL Description="Fluentd GELF forwarder"
USER root
RUN gem install fluent-plugin-input-gelf \
&& gem install fluent-plugin-gelf-hs \
&& gem sources --clear-all
COPY ./fluentd.conf /fluentd/etc/
ENV FLUENTD_CONF=fluentd.conf
USER fluent
EXPOSE 12201
EXPOSE 12201/udp
<source>
@type gelf
tag faas
bind 0.0.0.0
port 12201
protocol_type udp
</source>
<match **>
@type copy
<store>
@type gelf
host your-graylog-host.com
port 12201
protocol tcp
flush_interval 5s
max_retry_wait 30
num_threads 4
</store>
<store>
@type stdout
</store>
</match>
#!/bin/bash
docker run -p 12201:12201/udp -ti fluentd-gelf-forwarder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment