1
0
mirror of https://github.com/krislamo/graylog_demo synced 2024-09-19 21:50:36 +00:00

Fix logging to file and importing into Graylog

This commit is contained in:
Kris Lamoureux 2020-02-19 12:26:34 -05:00
parent 3269520279
commit 469a1c6d87
Signed by: kris
GPG Key ID: A30022791E1719A4
2 changed files with 20 additions and 7 deletions

View File

@ -3,6 +3,7 @@ USER root
RUN apt-get update \
&& apt-get -y install --no-install-recommends wget \
&& rm -rf /var/lib/apt/lists/*
RUN gem install fluent-plugin-rewrite-tag-filter
RUN gem install gelf
RUN cd /fluentd/plugins \
&& wget -q https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb

View File

@ -20,13 +20,25 @@
</source>
<match devel.*>
@type file
path /var/log/hostlogs/containers/${tag}
append true
<buffer tag>
timekey 5s
flush_mode immediate
</buffer>
@type copy
<store>
@type file
path /var/log/hostlogs/containers/${tag}
pos_file /var/log/hostlogs/httpd/access_log.pos
append true
<buffer tag>
timekey 5s
flush_mode immediate
</buffer>
</store>
<store>
@type rewrite_tag_filter
<rule>
key container_name
pattern /(.+)/
tag ${tag}.$1
</rule>
</store>
</match>
<match **>