How to push new information to Chukwa

Add a new dataSource (Source Input)

Using Log4J

Chukwa comes with a Log4J Appender. Here the steps that you need to follow in order to use it:

  1. Create a log4j.properties file that contains the following information:
    log4j.rootLogger=INFO, chukwa
    log4j.appender.chukwa=org.apache.hadoop.chukwa.inputtools.log4j.ChukwaDailyRollingFileAppender
    log4j.appender.chukwa.File=${CHUKWA_HOME}/logs/${RECORD_TYPE}.log
    log4j.appender.chukwa.DatePattern='.'yyyy-MM-dd
    log4j.appender.chukwa.recordType=${RECORD_TYPE}
    log4j.appender.chukwa.layout=org.apache.log4j.PatternLayout
    log4j.appender.chukwa.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
  2. Add these parameters to your java command line:
  3. Start your program. Now all your log statements should be written in ${CHUKWA_HOME}/logs/<YourRecordType_Here>.log

Static file like /var/log/messages

  1. Edit ${CHUKWA_HOME}/conf/initial_adaptors
  2. Add a line similar to this one:

This line will automatically register the "CharFileTailingAdaptorUTF8NewLine" adaptor for /var/log/messages

Register a file from another application/language

  1. Open a socket from your application to the ChukwaLocalAgent
  2. Write this line to the socket
  3. Close the socket