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]
-
How to Add Tags to My Fluentd Events
Here is how you can add tags to Fluentd events. Let's assume you configured Fluentd to process Nginx access logs from the access.log file with a source configuration like this: @type tail pa...
Questions -
How to Use Conditional Statements In Fluentd
Conditional statements can be seamlessly integrated into Fluentd's record_transformer plugin. Here’s how you can do it: @type recordtransformer enableruby true is_successful ${record["s...
Questions -
Fluentd
Learn how to use Fluentd to collect, process, and ship log data at scale, and improve your observability and troubleshooting capabilities.
Guides -
How to Rotate Log Files in Fluentd?
Fluentd offers the capability to set up log rotation, particularly useful when managing large volumes of logs that consume significant disk space. This feature can be configured through Fluentd's s...
Questions