|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.interceptor.HostInterceptor
public class HostInterceptor
Simple Interceptor class that sets the host name or IP on all events that are intercepted.
The host header is named host
and its format is either the FQDN
or IP of the host on which this interceptor is run.
Properties:
preserveExisting: Whether to preserve an existing value for 'host' (default is false)
useIP: Whether to use IP address or fully-qualified hostname for 'host' header value (default is true)
hostHeader: Specify the key to be used in the event header map for the host name. (default is "host")
Sample config:
agent.sources.r1.type = SEQ
agent.sources.r1.interceptors = i1
agent.sources.r1.interceptors.i1.type = host
agent.sources.r1.interceptors.i1.preserveExisting = true
agent.sources.r1.interceptors.i1.useIP = false
agent.sources.r1.interceptors.i1.hostHeader = hostname
agent.sources.r1.channels = c1
Nested Class Summary | |
---|---|
static class |
HostInterceptor.Builder
Builder which builds new instances of the HostInterceptor. |
static class |
HostInterceptor.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)
Modifies events in-place. |
List<Event> |
intercept(List<Event> events)
Delegates to intercept(Event) in a loop. |
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)
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)
in a loop.
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 |