|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.interceptor.RegexFilteringInterceptor
public class RegexFilteringInterceptor
Interceptor that filters events selectively based on a configured regular expression matching against the event body. This supports either include- or exclude-based filtering. A given interceptor can only perform one of these functions, but multiple interceptor can be chained together to create more complex inclusion/exclusion patterns. If include-based filtering is configured, then all events matching the supplied regular expression will be passed through and all events not matching will be ignored. If exclude-based filtering is configured, than all events matching will be ignored, and all other events will pass through. Note that all regular expression matching occurs through Java's built in java.util.regex package. Properties:
regex: Regular expression for matching excluded events. (default is ".*")
excludeEvents: If true, a regex match determines events to exclude, otherwise a regex determines events to include (default is false)
Sample config:
agent.sources.r1.type = SEQ
agent.sources.r1.interceptors = i1
agent.sources.r1.interceptors.i1.type = REGEX
agent.sources.r1.interceptors.i1.regex = (WARNING)|(ERROR)|(FATAL)
agent.sources.r1.channels = c1
Nested Class Summary | |
---|---|
static class |
RegexFilteringInterceptor.Builder
Builder which builds new instance of the StaticInterceptor. |
static class |
RegexFilteringInterceptor.Constants
|
Method Summary | |
---|---|
void |
close()
Perform any closing / shutdown needed by the Interceptor. |
void |
initialize()
Any initialization / startup needed by the Interceptor. |
Event |
intercept(Event event)
Interception of a single Event . |
List<Event> |
intercept(List<Event> events)
Returns the set of events which pass filters, according to intercept(Event) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void initialize()
Interceptor
initialize
in interface Interceptor
public Event intercept(Event event)
Interceptor
Event
.
intercept
in interface Interceptor
event
- Event to be intercepted
null
if the Event
is to be dropped (i.e. filtered out).public List<Event> intercept(List<Event> events)
intercept(Event)
.
intercept
in interface Interceptor
events
-
public void close()
Interceptor
close
in interface Interceptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |