https://github.com/eth2-networks/pysflow
sFlow parser, written in Python
https://github.com/eth2-networks/pysflow
network-monitoring sflow
Last synced: 3 months ago
JSON representation
sFlow parser, written in Python
- Host: GitHub
- URL: https://github.com/eth2-networks/pysflow
- Owner: eth2-networks
- License: bsd-3-clause
- Created: 2018-10-30T22:42:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-16T22:37:24.000Z (over 7 years ago)
- Last Synced: 2025-09-22T20:15:04.655Z (9 months ago)
- Topics: network-monitoring, sflow
- Language: Python
- Size: 11.7 KB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
pysflow
=======
A simple sFlow parser library for Python.
Requirements
------------
This project is built and tested against Python 3.6 and 3.7. Older versions
might or might not work. Tests for this are planned to be included in later
releases. The library has no external dependencies and only uses the built-in
``xdrlib`` and ``ipaddress`` functions.
Installation
------------
To install the library, run::
pip install pysflow
or if you have cloned this Git repository, run::
python setup.py install
Usage
-----
A very simple program that uses the library can be found in ``example.py``.
There is one high-level entry point, ``sflow.decode()``, which takes a byte
array as the argument. It will decode a raw sFlow datagram into a Python dict.
Each component (flow record, data type, etc.) can be used in a stand-alone way
by calling the static ``.decode()`` function on the class. This function takes
an ``xdrlib.Unpacker`` as an argument.