fluentd-ingest/docker/fluentd/fluent.conf

33 lines
685 B
Plaintext

<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<filter docker.**>
@type parser
key_name log
reserve_data true
expression /^(?<message>.*)\b(SIGTERM|SEVERE ERROR|FATAL|CRITICAL)\b/i
</filter>
# Route 1: Errors to Glitchtip
<match docker.**> # Matches docker logs containing the severity terms
@type exec
command "/go-glitch"
<buffer>
flush_interval 10s
</buffer>
<format>
@type json
</format>
run_interval 10s
</match>
# Route 2: Unfiltered to stdout
<match **> # Catch-all match for logs not matched by the error filter
@type copy # Duplicate to prevent original event modification
<store>
@type stdout
</store>
</match>