mirror of
https://github.com/krislamo/graylog_demo
synced 2024-11-09 21:50:35 +00:00
Fix logging to file and importing into Graylog
This commit is contained in:
parent
3269520279
commit
469a1c6d87
@ -3,6 +3,7 @@ USER root
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install --no-install-recommends wget \
|
&& apt-get -y install --no-install-recommends wget \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN gem install fluent-plugin-rewrite-tag-filter
|
||||||
RUN gem install gelf
|
RUN gem install gelf
|
||||||
RUN cd /fluentd/plugins \
|
RUN cd /fluentd/plugins \
|
||||||
&& wget -q https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb
|
&& wget -q https://raw.githubusercontent.com/emsearcy/fluent-plugin-gelf/master/lib/fluent/plugin/out_gelf.rb
|
||||||
|
@ -20,13 +20,25 @@
|
|||||||
</source>
|
</source>
|
||||||
|
|
||||||
<match devel.*>
|
<match devel.*>
|
||||||
@type file
|
@type copy
|
||||||
path /var/log/hostlogs/containers/${tag}
|
<store>
|
||||||
append true
|
@type file
|
||||||
<buffer tag>
|
path /var/log/hostlogs/containers/${tag}
|
||||||
timekey 5s
|
pos_file /var/log/hostlogs/httpd/access_log.pos
|
||||||
flush_mode immediate
|
append true
|
||||||
</buffer>
|
<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>
|
||||||
|
|
||||||
<match **>
|
<match **>
|
||||||
|
Loading…
Reference in New Issue
Block a user