Skip to main content

python-sshtail

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

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

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

        # wait a bit
        time.sleep(1)

except:
    tailer.disconnect()

Tailing multiple files

from sshtail import SSHMultiTailer

tailer = SSHMultiTailer({
    '1.2.3.4': ['/path/to/log1.log', '/path/to/log2.log'],
    '4.3.2.1': ['/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({
        '1.2.3.4': ['/path/to/log1.log', '/path/to/log2.log'],
        '4.3.2.1': ['/path/to/log3.log'],
    },
    private_key=load_dss_key('identity'))

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

Metadata

Release files for python-sshtail 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-sshtail 0.0.2
File Size Uploaded Provenance
python-sshtail-0.0.2.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for python-sshtail 0.0.2
File Interpreter ABI Platform
python_sshtail-0.0.2-py2.7.egg Legacy Egg format - - Details

Total release size: 11.9 kB

Release files / python-sshtail-0.0.2.tar.gz

Download URL python-sshtail-0.0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a7a45a4f5bbbdf8c1802099ea9d249261cec389046f3534770c476cf594e3e55
BLAKE2b-256 checksum
How to use checksums
954ba205df9c88d9a1653cdee0fbe886fe162a2482d23def972d8cb7046a6257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_sshtail-0.0.2-py2.7.egg

Download URL python_sshtail-0.0.2-py2.7.egg
Size 7.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
b3ad4e56c9eb5d7db03c0d857fad6390c0b83c3cc9b40e58aa1ed1a982037ea7
BLAKE2b-256 checksum
How to use checksums
9d381509b123e3b5d9f4f1afa83ed364a1d7163d4ae97257ecdabdbbe99a6cdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for python-sshtail 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page