Log tracker is a pythonic wrapper around paramiko, created to capture/read/tail text files using SSH. It gives you the ability to create any kind of custom python function to track text files on demand. To use this YAML file with credential data and a slight understanding about python(version 3) programming is more than enough.
name: example
hostname: 127.0.0.1
username: SSH_USERNAME
password: SSH_PASSWORD
log: /path/to/log/file/log.txt
text stream
object wil be provided by the Log Tracker.
Simply put your function in tasks.py
def example_function(text_stream):
# prepare text stream object
text_stream.load()
# tail log file, equals to tail -f in unix
for line in text_stream.tail():
print(line.rstrip("\n"))
TASKS
list in tasks_list.py
TASKS = {
"example": tasks.example_function
}
python3 ltrk.py
Log Tracker is a free software and heartily appreciates any kind of contribution, suggestions/issues or pull requests.