Network Automation and Programmability Abstraction Layer with Multivendor support: syslog parser
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file napalm-logs-0.11.0.tar.gz
.
File metadata
- Download URL: napalm-logs-0.11.0.tar.gz
- Upload date:
- Size: 69.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1a2dffc6555fdf92bd2bf710ea1789e0cdae2305622742ab274551b4b5ebf7f |
|
MD5 | be0557c14c2480e09f6d1a115fd23b0c |
|
BLAKE2b-256 | 6bece1a9090d27cc5c67a50b2f8b2e0e3484a0be303966221669a8d3c506d3e5 |
File details
Details for the file napalm_logs-0.11.0-py2.py3-none-any.whl
.
File metadata
- Download URL: napalm_logs-0.11.0-py2.py3-none-any.whl
- Upload date:
- Size: 120.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf5aca1a31d6f65f50156095ae720b8192db6a0aa443a0c3fa70ffb2eb7adc5 |
|
MD5 | 2d159a75007abc6c0cd14917731dde4a |
|
BLAKE2b-256 | f3c3420948cd1e2f28f4ed3eb3e192fe32652a38a7197ee8b60cab308efd1482 |