Skip to main content

Python FFI bindings for log-surgeon: high-performance parsing of unstructured logs into structured data

Project description

log-surgeon-ffi

Python bindings for log-surgeon, a high-performance library for parsing unstructured logs into structured data.

This package ships with type stubs, so IDEs like PyCharm and VS Code provide autocompletion, parameter hints, and inline documentation out of the box.

Installation

pip install log-surgeon-ffi

Quick start

from log_surgeon import Parser

parser = Parser()
parser.add_variable_pattern(
    "timestamp",
    r"(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})",
)
parser.add_variable_pattern("level", r"(?<level>INFO|WARN|ERROR)")
parser.compile()

parser.set_input_stream("10:30:00 INFO starting up")

while True:
    event = parser.next_log_event()
    if event is None:
        break
    print(f"log type: {event.log_type}")
    print(f"message:  {event.message}")
    for var in event.variables:
        print(f"  {var.name}: {var.text}")
        for name, values in var.captures.items():
            print(f"    {name}: {values}")

Output:

log type: %timestamp% %level% starting up
message:  10:30:00 INFO starting up
  timestamp: 10:30:00
    hours: ['10']
    minutes: ['30']
    seconds: ['00']
  level: INFO
    level: ['INFO']

Development

To develop the FFI bindings, refer to the log-surgeon contributing guide.

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 Distributions

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

log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (956.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (934.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

log_surgeon_ffi-0.1.0b11-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (956.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (934.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

log_surgeon_ffi-0.1.0b11-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (961.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (941.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

log_surgeon_ffi-0.1.0b11-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (962.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (940.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

log_surgeon_ffi-0.1.0b11-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (964.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (942.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

log_surgeon_ffi-0.1.0b11-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.7 MB view details)

Uploaded CPython 3.9macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7048bb71c9dc624de6a1e2e72269c77cbd50d82783c3b74c6b4fffd561078c5f
MD5 ce236de87cd95afa01501676484d2c53
BLAKE2b-256 1a330a124b13acddd9ec1f60314e818587cf26c0ad8151aa0a594f56aac1fd72

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4c3cb85a9029846cfe77e02261096581101ec2cc75e18fd48b59326e5a37f378
MD5 6073df7c9449d34d51b410fae6bb9389
BLAKE2b-256 0c3db94f3306c80c119a3a7a21368a0aeffe2791fb272e5bb280a97743245776

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a11d45999058cb006b33dc876da8a50160f01fe8285ad7d68ec7a13d966a436e
MD5 742a65a491b764f5d8a8d3f103b7b7d9
BLAKE2b-256 b3f738aa814b03226236030ec6c535e295b58e868cd31b2520d8a0d78a227736

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2e751193894c3bee5f57814d59abb58323384c14b1ba0f59f75b1d0182b22c5
MD5 fd29bf1a5feeb740e3929e279d5a2e9f
BLAKE2b-256 d3838c5bd4c2052c83e11b2e5dac03223220bbcb5e2f1e33e364bf30165b16ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3142b92182704af70dc72aa376243968bc96768a21c79db95406af94b00a36c0
MD5 59533ff47934d9562e19ef70e2f6f609
BLAKE2b-256 ea31400f1b546b342bd6e06b63ba88aba39534ec205b37c108fd78cdb575a862

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 12bdd0b2d8c6c8eee4ee29e8f2b7310d059be834688763e5ccbabe0f46831b1d
MD5 1d6031d8f78a7862ad96658c76c79043
BLAKE2b-256 e795f0b8b5287f12ab197c017ee636f1fc30ebce2ac037c34b35f1ed9f2a22ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aabc5edb5be6009d3ca3d5a63888eebd48d92310a7f9be0627ff70b7dd268cec
MD5 db3bb90212b748d25ce54c37fc952977
BLAKE2b-256 3aecb39376851f7ac8d8db5337650d6141489c5166696d214f16f5ff41ce370a

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50682e9528feef2101a70bf34cb864393b68b9778f22927d0d613779718f5174
MD5 d124c49988b548cb461e3535060459fa
BLAKE2b-256 b390108a1c8fb77be00a2e2018155ff64be74ae68d9b92687c183e143a953861

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 0f8b5cf5a9d94441b81387764718ae03c38e619786f2564074387705e2331246
MD5 af07c56c716da3c18928996f65413ad3
BLAKE2b-256 15e945c0cbe2ff20de9769a04d7bd4d78075236f9b610d9b091dd8756dd4c4e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86fdb222f5d85654e46d96db6fcb9d99f91fb5f2afc9c8c03e3114c4132dd738
MD5 44e2c9eedfa757bdb7a9a224d1339c03
BLAKE2b-256 94ad896e7d4c855297279463acd520ec5c79bf703711f3b4c018339408638f72

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b21bc4ae93c17a0f9bd10695c56e3780f05f966d090c5f1cf3eb845425aecfa0
MD5 96e32cd7d1b8e0ff00d08e98e38802bc
BLAKE2b-256 bef1c309038c3f9a9b6a6aad9caa1cafb82dad07e18ec7aabfd4c49d5bbbf962

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d2c3a82c8ba6bf4333122bc11ef8a6879237a118d3e7360b9eb7fc5eda429b2f
MD5 a084765e1ea338c0f8f8df4541237023
BLAKE2b-256 ef92934dee8f2bf38aeda0885d30b87269f70550df6bd0c37db6753bdeadbb79

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1ea72b8ea34fd35b078b2c3a11c312983691a887c7133d7bfa2ca40ec0b4d35c
MD5 669e243f15eda408280e682f1f6c57e1
BLAKE2b-256 ccca22a9f1a87196c5b817cebee2f4f7797090a48b08167aa0d46d46c2da4b58

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5e99effc6095a891a78ab515cdb4ab2665fd3c64dbb20803ccfc8729a07ad51c
MD5 1ac1dcaa173026efa17f9bafba06e6e0
BLAKE2b-256 789aa493f8e9b9da88410db0ca00dcf98200e1978ebfd4fee02f23ba535a9f92

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file log_surgeon_ffi-0.1.0b11-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for log_surgeon_ffi-0.1.0b11-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 cd3a632ff812ccc2433dc7ec716c49b45bfe99dd96d611350ced83e65d3eb140
MD5 f54b0029597d08eef60318b016aa8f0d
BLAKE2b-256 110857fb844a842bc00aba1adf04413f412150e72263dbdd6c77389216430b24

See more details on using hashes here.

Provenance

The following attestation bundles were made for log_surgeon_ffi-0.1.0b11-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: build_wheels.yml on y-scope/log-surgeon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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