Skip to main content

Dissect pattern implementation for ElasticSearch

Project description

He attac, he protec, but most importantly, he dissec.

dissec is a Python module used for implementing string dissection patterns, compatible with ElasticSearch’s Dissect processor.

The project is present at the following locations:

For example, you can dissect a string using this module with the following snippet:

from dissec.patterns import Pattern

pattern = Pattern.parse(
    r'%{clientip} %{ident} %{auth} [%{@timestamp}] \"%{verb} %{request} '
    + r'HTTP/%{httpversion}\" %{status} %{size}',
)
result = pattern.dissect(
    r'1.2.3.4 - - [30/Apr/1998:22:00:52 +0000] '
    + r'\"GET /english/venues/cities/images/montpellier/18.gif '
    + r'HTTP/1.0\" 200 3171',
)
print(result)

This will print the following, pretty-printed here for readability purposes:

{'@timestamp': '30/Apr/1998:22:00:52 +0000',
 'auth': '-',
 'clientip': '1.2.3.4',
 'httpversion': '1.0',
 'ident': '-',
 'request': '/english/venues/cities/images/montpellier/18.gif',
 'size': '3171',
 'status': '200',
 'verb': 'GET'}

See Dissecting a string using dissect patterns for more details on this usage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dissec-1.2.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

dissec-1.2-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file dissec-1.2.tar.gz.

File metadata

  • Download URL: dissec-1.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dissec-1.2.tar.gz
Algorithm Hash digest
SHA256 1a12129d07a711ef9a874e43aa27fda320aa0d71c71136301c56d911df25257b
MD5 0bdc32711898d33ce44acb9d7b646b32
BLAKE2b-256 4e4c0200ba1e932342a1e51fa76714472cfc979511550f4c08f43785df05cc60

See more details on using hashes here.

File details

Details for the file dissec-1.2-py3-none-any.whl.

File metadata

  • Download URL: dissec-1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dissec-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 709a3972dc3a3f1ac6b2632ebdb18d0bb9c65efef8469c76eb655d91fc6f2999
MD5 d84069020f538afa18040e5d3016fe35
BLAKE2b-256 06e184e06424aebc5b40b9c3f1cb19d2492a47489f240e08d3c4a8fa8b1c3a1f

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