Skip to main content

Napalm-logs

Python library to parse syslog messages from network devices and produce JSON serializable Python objects, in a vendor agnostic shape. The output objects are structured following the OpenConfig or IETF YANG models.

For example, the following syslog message from a Juniper device:

Mar 30 12:45:19 re0.edge01.bjm01 rpd[15852]: BGP_PREFIX_THRESH_EXCEEDED 1.2.3.4 (External AS 15169): Configured maximum prefix-limit threshold(160) exceeded for inet-unicast nlri: 181 (instance master)

Will produce the following object:

      {
        "yang_message": {
              "bgp": {
                "neighbors": {
                      "neighbor": {
                        "192.168.140.254": {
                              "state": {
                                "peer_as": "65001"
                              },
                              "afi_safis": {
                                "afi_safi": {
                                      "inet4": {
                                        "state": {
                                              "prefixes": {
                                                "received": 141
                                              }
                                        },
                                        "ipv4_unicast": {
                                              "prefix_limit": {
                                                "state": {
                                                      "max_prefixes": 140
                                                }
                                              }
                                        }
                                      }
                                }
                              }
                        }
                      }
                }
              }
        },
        "message_details": {
              "processId": "2902",
              "severity": 5,
              "facility": 18,
              "hostPrefix": null,
              "pri": "149",
              "processName": "rpd",
              "host": "vmx01",
              "tag": "BGP_PREFIX_THRESH_EXCEEDED",
              "time": "14:03:12",
              "date": "Jun 21",
              "message": "192.168.140.254 (External AS 65001): Configured maximum prefix-limit threshold(140) exceeded for inet4-unicast nlri: 141 (instance master)"
        },
        "timestamp": 1498050192,
        "facility": 18,
        "ip": "127.0.0.1",
        "host": "vmx01",
        "yang_model": "openconfig-bgp",
        "error": "BGP_PREFIX_THRESH_EXCEEDED",
        "os": "junos",
        "severity": 5
      }
}

The library is comes with a command line program which acts as a daemon, running in background and listening to syslog messages continuously, then publishing them over secured channels, where multiple clients can subscribe.

It is flexible to listen to the syslog messages via UDP or TCP, but also from brokers such as Apache Kafka. Similarly, the output objects can be published via various channels such as ZeroMQ, Kafka, or remote server logging. It is also pluggable enough to extend these capabilities and listen or publish to other services, depending on the needs.

The messages are published over a secured channel, encrypted and signed. Although the security can be disabled, this is highly discouraged.

Documentation

Please check the official documentation for more detailed information.

Install

napalm-logs is available on PyPi and can easily be installed using the following command:

pip install napalm-logs

Metadata

Release files for napalm-logs 0.11.0

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

Source distribution (sdist)

Source distribution for napalm-logs 0.11.0
File Size Uploaded
napalm-logs-0.11.0.tar.gz 69.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for napalm-logs 0.11.0
File Interpreter ABI Platform
napalm_logs-0.11.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 190.6 kB

Release files / napalm-logs-0.11.0.tar.gz

Download URL napalm-logs-0.11.0.tar.gz
Size 69.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a1a2dffc6555fdf92bd2bf710ea1789e0cdae2305622742ab274551b4b5ebf7f
BLAKE2b-256 checksum
How to use checksums
6bece1a9090d27cc5c67a50b2f8b2e0e3484a0be303966221669a8d3c506d3e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / napalm_logs-0.11.0-py2.py3-none-any.whl

Download URL napalm_logs-0.11.0-py2.py3-none-any.whl
Size 120.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
adf5aca1a31d6f65f50156095ae720b8192db6a0aa443a0c3fa70ffb2eb7adc5
BLAKE2b-256 checksum
How to use checksums
f3c3420948cd1e2f28f4ed3eb3e192fe32652a38a7197ee8b60cab308efd1482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15
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