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 parse configuration items in Fluentd

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Some plug-ins in Fluentd support configuration items to customize parsing methods for input data.

For example, for a general application, the input to Fluentd is line by line of text, and developers can configure to parse the text into meaningful JSON objects to facilitate subsequent processing.

Parse Overview parse configuration items can be used in, or. If you use a plug-in that supports the parser feature, the parse configuration item takes effect. @ type tail # parameters for input plugin # parse section parameters

Here, the input to tail needs to be parsed by the parser specified by parse.

Parser plug-in type

The configuration item needs to specify the type of parser through the @ type parameter. The Fluentd kernel bundles many useful parser plug-ins, and you can install other third-party parsers as needed. @ type apache2

Here, @ type specifies that the apache2 parser is used to parse the input log.

Parse parameter description @ typeFluentd built-in parsers include: regexp, apache2, apache_error, nginx, syslog, csv, tsv, ltsv, json, multiline, none

Optional parameters, the default values of these parameters will change depending on the parser used, you can refer to the instructions for the use of the relevant parser. Types: data types used to convert fields. Supported data types are: string, bool, integer, float, timetypes user_id:integer,paid:bool,paid_usd_amount:float

Time_key: specifies the field used by the event time attribute. If the event does not contain this field, the current time keep_time_key:true will be used and the time field in record will be retained. Default falsetimeout: sets the parsing processing timeout, which is mainly used to detect regular matching of errors.

Further explanation of time if you parse a field of record to the time of an event, you need to explain how to parse this "time field". This can be described by the following parameters. Time_type: the time format used in the time field, which supports float, unixtime, and string formats. Float: seconds from Epoch + nano seconds (e.g. 1510544836.154709804) unixtime: seconds from Epoch (e.g. 1510544815) string: use format specified by time_format, localtime or time zonetime_format: used to describe the time format when time_type is string, localtime:true uses localtime as the timeutc:true of the event, UTC is used as the time of the event, and the localtime above is a mutually exclusive configuration timezone: time zone format

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