Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Flume >> mail # user >> Adding an interceptor


+
Rahul Ravindran 2012-11-07, 21:18
Copy link to this message
-
Re: Adding an interceptor
Rahul,

The interceptor adds headers, not content to the body. Unless you are somehow writing the headers out, you will not see the headers in the output. The sequence of numbers you see are generated by the SEQ source - which is what it does.
Hari

--
Hari Shreedharan
On Wednesday, November 7, 2012 at 1:18 PM, Rahul Ravindran wrote:

> Apologies. I am new to Flume, and I am probably missing something fairly obvious. I am attempting to test using a timestamp interceptor and host interceptor but I see only a sequence of numbers in the remote end.
>
> Below is the flume config:
>
>
>
> agent1.channels.ch1.type = MEMORY
> agent1.channels.ch1.capacity = 500
>
> agent1.sources.seq_gen.channels = ch1
> agent1.sources.seq_gen.type = SEQ
>
> agent1.sources.seq_gen.interceptors = inter1 host1
> #agent1.sources.seq_gen.interceptors.inter1.type = org.apache.flume.interceptor.TimestampInterceptor$Builder
> agent1.sources.seq_gen.interceptors.inter1.type = TIMESTAMP
> agent1.sources.seq_gen.interceptors.inter1.preserveExisting = false
>
> #agent1.sources.seq_gen.interceptors.host1.type = org.apache.flume.interceptor.HostInterceptor$Builder
> agent1.sources.seq_gen.interceptors.host1.type = HOST
> agent1.sources.seq_gen.interceptors.host1.preserveExisting = false
> agent1.sources.seq_gen.interceptors.host1.hostHeader = hostname
> agent1.sources.seq_gen.interceptors.host1.useIP = false
>
>
> agent1.sinks.avroSink1.type = avro
> agent1.sinks.avroSink1.channel = ch1
> agent1.sinks.avroSink1.hostname = <remote server>
> agent1.sinks.avroSink1.port = 4545
> agent1.sinks.avroSink1.connect-timeout = 300000
>
> agent1.channels = ch1
> agent1.sources = seq_gen
> agent1.sinks = avroSink1
>
>
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB