Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use out_copy in Fluentd

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to use out_copy in Fluentd, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Copy is replication, and the function of out_copy is to copy log events to multiple outputs, so that different types of analysis can be done on the same log.

Out_copy is built into Fluentd and does not need to be installed separately.

Sample configuration

@ type copy @ type file path / var/log/fluent/myapp1...

This example outputs logs to local files and other n destinations.

These destinations are designated by the operator.

Parameter description

@ type

Plug-in type, whose value is copy

Copy_mode

Specifies how log events are delivered between plug-ins.

It includes the following delivery methods:

No_copy:

Do not produce a copy of the log, each share a log event.

This is the default delivery method.

This means that if someone makes a change to the log, the others will inherit the change as well.

Shallow:

A shallow copy is used to pass log events between.

Replication is to prevent one change to the log from affecting others.

Shallow copy and deep copy are two ways of object replication, mainly aiming at whether there are nested reference objects in the object.

If the object is nested to other objects, the shallow copy does not copy the referenced object, while the deep copy copies what the referenced object points to.

If the plug-in in modifies log events but does not modify nested reference objects, you can use shallow copy

If you need to modify nested reference objects, you need to use the following two deep copy methods.

Deep:

Use a deep copy to pass log events in the plug-in.

Msgpack-ruby is used internally to copy data.

Marshal:

If msgpack-ruby cannot make a deep copy of the data, you can try using marshal.

It is important to note that marshal is very slow.

Specify the storage destination. It is used in a similar way, in which you can use a variety of output plug-ins.

At least one out_copy plug-in must be configured.

An optional parameter is supported: ignore_error.

In multiple scenarios, if one throws an error, it will affect the other.

For example:

@ type copy @ type plugin1 @ type plugin2

If an error occurs in plugin1, the plugin2 will not be executed.

You can enable ignore_error in to prevent this from happening.

@ type copy @ type plugin1 @ type plugin2

On how to use out_copy in Fluentd to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report