Skip to content

Commit

Permalink
Correct fluent.d multi-line exception handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baizley committed Sep 25, 2020
1 parent 5fe3db3 commit 2f6970c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
6 changes: 5 additions & 1 deletion fluentd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM fluent/fluentd
FROM fluent/fluentd:v1.11.2-1.0

USER root

RUN gem install fluent-plugin-elasticsearch -v 1.18.0 && \
gem install fluent-plugin-detect-exceptions && \
gem install fluent-plugin-route && \
gem sources --clear-all && \
rm -rf \
/var/cache/apk/* \
Expand Down
40 changes: 27 additions & 13 deletions fluentd/baizley.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@
</source>

<match **>
@type elasticsearch
host cloud.humio.com
port 9200
scheme https
ssl_version TLSv1_2
user "#{ENV['REPOSITORY']}"
password "#{ENV['INGEST_TOKEN']}"
logstash_format true
<parse>
@type multiline
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?<time>\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}) \[(?<thread>.*)\] (?<level>[^\s]+)(?<message>.*)/
</parse>
@type route
add_tag_prefix unparsed
<route **>
copy
@label @UNPARSED
</route>
</match>

<label @UNPARSED>
<match unparsed.**>
@type detect_exceptions
remove_tag_prefix unparsed
message log
languages java
multiline_flush_interval 0.1
</match>
<match **>
@type elasticsearch
host cloud.humio.com
port 9200
scheme https
ssl_version TLSv1_2
user "#{ENV['REPOSITORY']}"
password "#{ENV['INGEST_TOKEN']}"
logstash_format true
</match>
</label>

0 comments on commit 2f6970c

Please sign in to comment.