Skip to main content

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


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

If you're not sure about the file name format, learn more about wheel file names.

cgn_ec_rust_parsers-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (901.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file cgn_ec_rust_parsers-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for cgn_ec_rust_parsers-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 db41a59b6041b327402f93a3506b4cd1ee45bd33e61a6043c884687d11a7e9d9
MD5 fde2a50e288e9d80fb1b8958c94f2751
BLAKE2b-256 b60a28099dbe87c041270a3505170a9dca187611cba5c4bbc9e4c28aa16d725c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page