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

What is the method of Fluentd input plug-in

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "what is the method of Fluentd input plug-in". In daily operation, I believe many people have doubts about the method of Fluentd input plug-in. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what is the method of Fluentd input plug-in?" Next, please follow the editor to study!

Tail

The in_tail input plug-in reads events from the end of the text file, similar to the tail-F command in linux.

The format is as follows

@ type tail path / var/log/httpd-access.log pos_file / var/log/td-agent/httpd-access.log.pos tag apache.access @ type apache2

Eg:

Create an etc directory and fluent.conf configuration file under the current directory

$mkdir etc$vim etc/fluent.conf

The configuration is as follows

@ type tail path / tmp/test.log pos_file / tmp/test.log.pos tag test.log @ type none @ type copy @ type stdout @ type file path / tmp/test_backup/

Create docker

$docker run-d-- name fluentd-v $(pwd) / etc:/fluentd/etc-v $(pwd) / tmp:/tmp fluent/fluentd$ docker logs fluentd2020-08-10 17VAND 31.047687752 + 0000 test.log: {"message": "hell world"}

View backup files

View the contents of the backup file

In_forward

The in_forward plug-in is typically used to receive log events from other nodes, including other Fluentd instances, fluent-cat command lines, or Fluentd client programs. This is the most efficient way to receive log events.

The in_forward plug-in opens a tcp listening socket locally to receive log events. At the same time, it also opens a udp port to receive and peer heartbeat keep alive messages.

In_forward can receive data in json or MessagePack format, and it automatically detects which format the source data is. MessagePack is the data encapsulation format used internally by Fluentd because it is more efficient than json.

The in_forward plugin is built into Fluentd and does not need to be installed.

In_http

The in_http plug-in allows you to use the HTTP protocol to collect log events. The plug-in creates a REST-style HTTP endpoint to receive log event requests.

At this point, the study on "what is the method of Fluentd input plug-in" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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