No project description provided
Project description
CGN Event Consumer Rust Parser
A fast Rust implementation for regex pattern matching in CGN event parsing.
Installation
cd cgn-ec-rust-parsers
pip install maturin
maturin develop
Usage Example
from cgn_ec_rust_parsers import RegexMatcher
# Create a new matcher
matcher = RegexMatcher()
# Add patterns with their event types
matcher.add_pattern(r"([AD]) VRF (\d+) (\d+) INT (\d+\.\d+\.\d+\.\d+):(\d+) EXT (\d+\.\d+\.\d+\.\d+):(\d+) DST (\d+\.\d+\.\d+\.\d+):(\d+) DIR (OUT|IN)$", "session_mapping")
matcher.add_pattern(r"([AD]) VRF (\d+) (\d+) INT (\d+\.\d+\.\d+\.\d+):(\d+) EXT (\d+\.\d+\.\d+\.\d+):(\d+)$", "port_mapping")
# Match a message
message = "A VRF 0 6 INT 10.0.0.1:57938 EXT 100.64.0.1:28475 DST 185.165.123.206:443 DIR OUT"
result = matcher.match_message(message)
if result:
event_type, captures = result
print(f"Event type: {event_type}")
print(f"Captures: {captures}")
else:
print("No match found")
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cgn_ec_rust_parsers-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: cgn_ec_rust_parsers-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 901.8 kB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db41a59b6041b327402f93a3506b4cd1ee45bd33e61a6043c884687d11a7e9d9
|
|
| MD5 |
fde2a50e288e9d80fb1b8958c94f2751
|
|
| BLAKE2b-256 |
b60a28099dbe87c041270a3505170a9dca187611cba5c4bbc9e4c28aa16d725c
|