[ 
https://issues.apache.org/jira/browse/FLUME-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14062917#comment-14062917
 ] 

Bijith Kumar commented on FLUME-2422:
-------------------------------------

Thanks Jonathan for the quick response. 
Sorry I missed to mention that I am trying to configure log4j appender as 
embedded flume agent. The source-name in this case is always "log4j-source" is 
what I guess 
(http://logging.apache.org/log4j/2.x/manual/appenders.html#FlumeAppender)
I am trying to add a custom interceptor to a log4j appender source in an 
embedded agent
Any idea how to configure this? 
Following is the log4j2.xml file I am using. Appreciate your help

<?xml version="1.0" encoding="UTF-8" ?>

<Configuration status="error" name="MyApp" packages="">
  <Appenders>
    <Flume name="eventLogger" type="Embedded">
    
     <!-- <Property name="source.interceptor">eventTypeInterceptor</Property>
     <Property 
name="eventTypeInterceptor.type">abc.def.flume.interceptor.EventTypeInterceptor$Builder</Property>
 -->
    
      <!-- <Property name="channels">file</Property> -->
      <Property name="channel.type">file</Property>
      <Property 
name="channel.checkpointDir">flumedata/file-channel/checkpoint</Property>
      <Property name="channel.dataDirs">flumedata/file-channel/data</Property>
      <Property name="sinks">agent1</Property>
      <Property name="agent1.channel">file</Property>
      <Property name="agent1.type">avro</Property>
      <Property name="agent1.hostname">localhost</Property>
      <Property name="agent1.port">44444</Property>
      <Property name="agent1.batch-size">100</Property>
      <!-- <Property name="agent2.channel">file</Property>
      <Property name="agent2.type">avro</Property>
      <Property name="agent2.hostname">localhost</Property>
      <Property name="agent2.port">55555</Property>
      <Property name="agent2.batch-size">100</Property> -->
     <!--  <Property name="sinkgroups">group1</Property>
      <Property name="group1.sinks">agent1 agent2</Property> -->
      <Property name="processor.type">default</Property>
     <!--  <Property name="processor.priority.agent1">10</Property>
      <Property name="processor.priority.agent2">5</Property> -->
      <!-- <RFC5424Layout enterpriseNumber="18060" includeMDC="true" 
appName="MyApp"/> -->
      <PatternLayout pattern="%m"/>
    </Flume>
    <Console name="STDOUT">
      <!-- <PatternLayout pattern="%d [%p] %c %m%n"/> -->
      <PatternLayout pattern="%m%n"/>
    </Console>
  </Appenders>
  <Loggers>
  
  <Root level="DEBUG">
      <AppenderRef ref="eventLogger" level="INFO"/>
      <AppenderRef ref="STDOUT" level="DEBUG"/>
    </Root>
    
    <!-- <Logger name="EventLogger" level="info">
      <AppenderRef ref="eventLogger"/>
    </Logger>
    <Root level="warn">
      <AppenderRef ref="STDOUT"/>
    </Root> -->
  </Loggers>
</Configuration>

> Do we have any documentation on how to configure interceptors for flume log4j 
> appender?
> ---------------------------------------------------------------------------------------
>
>                 Key: FLUME-2422
>                 URL: https://issues.apache.org/jira/browse/FLUME-2422
>             Project: Flume
>          Issue Type: Question
>          Components: Configuration, Docs
>            Reporter: Bijith Kumar
>
> The current doc says "Interceptors can be specified for the source using 
> "sources.log4j-source.interceptors"". However, this doesn't work. As the 
> property name syntax is a bit different for xml configuration, I did try 
> different properties like "source.interceptors", "interceptors" and 
> "interceptor" etc. None worked. I could not find any reference to 
> interceptors in  EmbeddedAgentConfiguration.java either



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to