Fluentd
Search…
copy
The copy output plugin copies events to multiple outputs.

Example Configuration

out_copy is included in Fluentd's core. No additional installation process is required.
1
<match pattern>
2
@type copy
3
<store>
4
@type file
5
path /var/log/fluent/myapp1
6
...
7
</store>
8
<store>
9
...
10
</store>
11
<store>
12
...
13
</store>
14
</match>
Copied!
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.)
1
<match myevent.file_and_mongo>
2
@type copy
3
<store>
4
@type file
5
path /var/log/fluent/myapp
6
time_slice_format %Y%m%d
7
time_slice_wait 10m
8
time_format %Y%m%dT%H%M%S%z
9
compress gzip
10
utc
11
</store>
12
<store>
13
@type mongo
14
host fluentd
15
port 27017
16
database fluentd
17
collection test
18
</store>
19
</match>
Copied!

Parameters

type (required)

The value must be copy.

deep_copy

out_copy shares a record between store plugins by default.
When deep_copy is true, out_copy passes different record to each store plugin.

<store> (at least one required)

Specifies the storage destinations. The format is the same as the \ directive.

log_level option

The log_level option allows the user to set different levels of logging for each plugin. The supported log levels are: fatal, error, warn, info, debug, and trace.
Please see the logging article for further details.

FAQ

How to ignore each error in \\?

If one 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.
Last modified 1yr ago