copy output plugin copies events to multiple outputs.
out_copy is included in Fluentd's core. No additional installation process is required.
<match pattern>@type copy<store>@type filepath /var/log/fluent/myapp1...</store><store>...</store><store>...</store></match>
Please see the Config File article for the basic structure and syntax of the configuration file.
Here is an example set up to send events to both a local file under
/var/log/fluent/myapp and the collection
fluentd.test in a local MongoDB instance (Please see the out_file and out_mongo articles for more details about the respective plugins.)
<match myevent.file_and_mongo>@type copy<store>@type filepath /var/log/fluent/myapptime_slice_format %Y%m%dtime_slice_wait 10mtime_format %Y%m%dT%H%M%S%zcompress gziputc</store><store>@type mongohost fluentdport 27017database fluentdcollection test</store></match>
The value must be
out_copy shares a record between
store plugins by default.
deep_copy is true,
out_copy passes different record to each
Specifies the storage destinations. The format is the same as the \ directive.
log_level option allows the user to set different levels of logging for each plugin. The supported log levels are:
Please see the logging article for further details.
store raises an error, it affects other
<store>. If you want to ignore an exception from less important
<store>, you can use 3rd party out_copy_ex instead.
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is a open source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.