public class HostInterceptor extends Object implements Interceptor
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
Modifier and Type | Class and Description |
---|---|
static class |
HostInterceptor.Builder
Builder which builds new instances of the HostInterceptor.
|
static class |
HostInterceptor.Constants |
Modifier and Type | Method and Description |
---|---|
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. |
public void initialize()
Interceptor
initialize
in interface Interceptor
public Event intercept(Event event)
intercept
in interface Interceptor
event
- Event to be interceptednull
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
Copyright © 2009–2019 Apache Software Foundation. All rights reserved.