Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python classes to allow for tailing of multiple files via SSH.

Project Description

A simple set of Python classes to facilitate tailing of one or more files via SSH. At the moment it only supports key-based SSH’ing.

Quick installation

Install from PyPI:

> easy_install -U python-sshtail

Tailing a single file

from sshtail import SSHTailer
from time import sleep

# "" is the IP address or host name you want to access
tailer = SSHTailer('', '/var/log/path/to/my/logfile.log')

    while 1:
        for line in tailer.tail():
            print line

        # wait a bit


Tailing multiple files

from sshtail import SSHMultiTailer

tailer = SSHMultiTailer({
    '': ['/path/to/log1.log', '/path/to/log2.log'],
    '': ['/path/to/log3.log'],

# will run until it receives SIGINT, after which it will
# automatically catch the exception, disconnect from the
# remote hosts and perform cleanup

for host, filename, line in tailer.tail():
    print "%s:%s - %s" % (host, filename, line)

Using a custom private key

from sshtail import SSHMultiTailer, load_dss_key

# if no path's specified for the private key file name,
# it automatically prepends /home/<current_user>/.ssh/
# and for RSA keys, import load_rsa_key instead.

tailer = SSHMultiTailer({
        '': ['/path/to/log1.log', '/path/to/log2.log'],
        '': ['/path/to/log3.log'],

for host, filename, line in tailer.tail():
    print "%s:%s - %s" % (host, filename, line)

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(7.2 kB) Copy SHA256 Hash SHA256
Egg 2.7 Sep 19, 2011
(4.7 kB) Copy SHA256 Hash SHA256
Source None Sep 19, 2011

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers