Flume interceptors, Monitor

First, the interceptor

1, the interceptor: a major role in the interceptors between the source and Channel, a header message is provided to header event, if the interceptor is not set, only the event message.

 

Common interceptors are:

Timestamp Interceptor interceptor Time: The time stamp is inserted into the header.

Host Interceptor host interceptor: The ip address or host name of the server is inserted into the header.

Regex Filtering Interceptor interceptor regular filter: filters out unwanted log.

https://blog.csdn.net/jinywum/article/details/82598947

 

2, custom interceptors: The main purpose is to classify the log, custom interceptor header is set for each event, header marks the type of log in. When the data transfer according to kafka can know which type belongs the log header.

Custom interceptor operations:

a, is introduced in dependence flume project file pom

b, find existing TimestampInterceptor class, copy the code into your own custom class, make changes on demand.

c, the project labeled jar package, change the name to app_logs_flume.jar, then put / opt / module / flume under / lib directory.

d, specify the interceptor type flume profile.

a1.sources.r1.interceptors = i1 

a1.sources.r1.interceptors.i1.type = custom class full class name

 

https://blog.csdn.net/u012443641/article/details/80757229

 

Second, monitor

1, the monitor

 Monitor can be seen:

try to write the number of event source in the channel and successful event and the number of written submissions;

try to sink the number of event pulls from the channel, the number of events successfully read;

channel-related information, such as: start time, stop time, the current total number of event, capacity, occupancy percentage

 

 

Guess you like

Origin www.cnblogs.com/guoyu1/p/12021140.html