To direct logs matching a specific tag to multiple outputs in Fluentd, the @type copy directive can be utilized. Here's an example configuration:
The copy plugin in Fluentd is designed to duplicate log events and send them to multiple destinations. The <store> section within the <match> block is where you define and configure the storage output for each duplicated log entry.
Suppose you have a source generating logs:
To send these logs to both a file and standard output, you can configure it as follows:
When running Fluentd, you will see the logs in the console:
Simultaneously, a /var/log/mytestapp directory will be created, containing two files:
Viewing the file ending with .log will display the log contents:
🔭 Want to centralize and monitor your logs?
Go to Logtail and start your log management in 5 minutes. [/summary]
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.