Introducing KafkaTailer
Kafka is a game-changer. As a powerful, centralized messaging tool, it performs extraordinarily well compared to other messaging applications. Popular in the JVM-Nux-Nix realms, it is now possible to add your favorite Microsoft IIS application to your streaming pipeline. Using the best open-source libraries available, KafkaTailer can stream your IIS logs to any Kafka topic.
The flexibility of this tool comes from the simplicity of its approach: It simply tails standard log files. Combining the Apache IO Tailer, the latest Kafka Producer, and the Apache Commons Daemon, KafkaTailer watches your IIS log directory and sends the log messages up to a Kafka server. Within minutes, it’s possible to start sending your IIS logs out to Kafka.
Quick Start
- Open up the administration you IIS instance.
- Configure the logs that interest you to log to a dedicated directory.
- If you don’t have a Java Virtual Machine on your Windows machine, you will need to install it.
- Setup a Kafka instance to publish your logs to, if you don’t have one already.
- Go to https://github.com/johnmpage/KafkaTailer. Read the summary.
- Download the latest release of KafkaTailer (currently v2.1).
- Configure the Kafka Producer with a kafka-producer.properties file. The minimal set of values would be as follows:
bootstrap.servers=127.0.0.1:9092 value.serializer=org.apache.kafka.common.serialization.StringSerializer key.serializer=org.apache.kafka.common.serialization.StringSerializer
- Open up a command prompt and type the following command, substituting values that reflect your environment as needed:
java -classpath kafka-tailer-2.1-jar-with-dependencies.jar net.johnpage.kafka.KafkaTailer directoryPath=C:\\iis-logs\\W3SVC1\\ producerPropertiesPath=C:\\iis-logs\\kafka-producer.properties kafkaTopic=a-topic - Open you browser and navigate to your IIS website.
- KafkaTailer reports its operations in the command prompt. Confirm that it has started up successfully and no exceptions are being thrown.
- Monitor your Kafka topic and review the logs are being added to the topic.
Once the basic setup is working, you will probably want to configure your Kafka Producer to use SSL, refine which fields the IIS logs make use of, and run KafkaTailer as a Windows Service.
Setting up a Windows Service
Included in the KafkaTailer project is the skeleton of a Microsoft Windows Service. If you’ve run Tomcat on Windows, the GUI will be familiar to you. Apache Tomcat uses the same Daemon project as KafkaTailer does.
The Windows service is included in the winsrvc directory. The install.bat script and the kafka-producer.properties file will require customization to reflect your environment.
Note
Please report any bugs or issues!
