Skip to content

Tail a log file and send log lines automatically to a kafka topic

License

Notifications You must be signed in to change notification settings

itofinity/tail2kafka

This branch is 1 commit ahead of harelba/tail2kafka:master.

Repository files navigation

tail2kafka

Overview

tail2kafka is a linux tool for sending log lines into a kafka topic.

It supports local and remote kafka servers, log rotation and batching messages to kafka.

Great thanks to Daniel Sully's pykafka (https://github.com/dsully/pykafka).

Contact

Any feedback/suggestions/complaints regarding this tool would be much appreciated. Contributions are most welcome as well, of course.

Harel Ben-Attia, [email protected], @harelba on Twitter

Fork

use Kafka library ... https://towardsdatascience.com/kafka-python-explained-in-10-lines-of-code-800e3e07dad1

pip install kafka-python

To run

python ./tail2kafka/tail2kafka -l /Users/mminns/projects/stash.atlassian.com/jiraserver/jira-wt/atlassian_jira_8_8_branch/jirahome-clustered/**/log/audit/ -t atlassian-jira-audit -s localhost -p 9092

NB. ./tail2kafka/tail2kafka -l /Users/mminns/projects/stash.atlassian.com/jiraserver/jira-wt/atlassian_jira_8_8_branch/jirahome-clustered/**/log/audit/ -t atlassian-jira-audit -s localhost -p 9092

throws Traceback (most recent call last): File "./tail2kafka/tail2kafka", line 5, in from kafka import KafkaProducer ImportError: No module named kafka

but

python ./tail2kafka/tail2kafka -l ....

works ??????

About

Tail a log file and send log lines automatically to a kafka topic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%