flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DeCarlo, Thom" <tdeca...@mitre.org>
Subject Re: Host Interceptor
Date Thu, 06 Dec 2012 16:16:12 GMT
Instead of changing the body text in an interceptor, I made a modified BodyTextEventSerializer.java
called HeaderAndBodyTextEventSerialzer.java. The only difference, other than the class name,
was two lines in the write() function:

  public void write(Event e) throws IOException {
    String eString = e.getHeaders() + " ";
    if (appendNewline) {

The configuration file then adds the serializer to the sink specification:
agent1.sinks.fileSink-1.sink.serializer = org.apache.flume.serialization.HeaderAndBodyTextEventSerializer$Builder

I should probably move my changes to my own local class, but this works for now.
Thom DeCarlo

On Tue, 04 Dec 2012 17:15:06 GMT, Brock Noland <br...@cloudera.com> wrote:
> Hi,
> The host interceptor adds the host to the headers, not the body. You'd
> need to create a new one to add it to the event.
> Brock

View raw message