Agent and CLI for real time sharing of log files.
Tail Agent is a python application which will tail the file content of the input file and send the content to kafka server. Tail CLI is a python applicaton which consumes the file content from kafka server and show them on console.
- Real time file content should be shared 👍
- If file is rotated, then it must get truncated. Truncate case handling. 👍
- If file is moved, the OS itself will give error saying - "Device or Resource is in use." 👍
- Kafka setup is required. For local kafka setup please refer - https://kafka.apache.org/quickstart
- Execute the following command to create remote-tail kafka topic
bin/kafka-topics.sh --create --topic remote-tail --bootstrap-server <Kafka-server-endpoint>:<kafka-server-port>
- It is recommended to use conda or python virtual-env. To setup miniconda please refer - https://docs.conda.io/en/latest/miniconda.html
- To setup tail agent or cli please clone the repo using -
git clone https://github.com/parthw/remote-tail.git
cd remote-tail
make install-agent
make install-cli
- Edit the configuration file of tail-agent and tail-cli in config directory.
- To start the tail-agent please execute -
make start-agent
- To start the cli please execute -
python3 tail-cli/main.py <ip address> <filename>
- To execute pylint or unittests please check make help using -
make help
- Dockerfile.build - To execute the pylint, unittests or security tools on Tail Agent
- Dockerfile - To build the tail-agent image
- kuberentes-deployment.yaml - Manifest to deploy the image to kuberentes
- Jenkinsfile - To perform the CI/CD
- Setup Jenkins
- Create a new pipeline type job and configure the jenkinsfile.
- Click on Build.
- While creating topic, number partition and replication can be configured.
- Currently, the code supports single file tail. We can enhance the multi-process setup in tail-agent to support multiple file tailing.
- Currently, tail-cli is sending request via IP to one server, in case of multiple servers we can broadcast the messages to multiple servers. [That is needed to look into]
If you have suggestions, please open an issue or better yet, a pull request.
Be nice. 😄