A match block tells Fluentd what to do with records whose tags fit a pattern. Use ordered matches to route verbose logs away from long-term storage while keeping other application logs in Elasticsearch. section 19.4
Listing 19.4 Sending log entries to different targets based on the tag
<match gallery.access-log.**>
@type copy
<store>
@type stdout
</store>
</match>
<match gallery.**>
@type copy
<store>
@type elasticsearch
. . .
The configuration routes gallery.access-log records to stdout and other gallery records to Elasticsearch, using tag patterns and copy stores. section 19.4
A practical filtering workflow:
- Tag records through the logging driver, then match the tag prefix in Fluentd. section 19.4
- Send verbose access-log records to Fluentd stdout instead of Elasticsearch. section 19.4
- Change the Fluentd configuration and redeploy it without changing application containers. section 19.4
