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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dissec-1.0.tar.gz
.
File metadata
-
Download URL:
dissec-1.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
-
Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.21 Linux/5.15.154+
File hashes
Hashes for dissec-1.0.tar.gz
Algorithm |
Hash digest |
|
SHA256 |
ae3baa83bdc58d33293692ebb056a9e51d93f7a1c2154d45baee8bac95c761bc |
|
MD5 |
416f69b55c7758af5de5ea0443ffb118 |
|
BLAKE2b-256 |
4faa67a17f54efb5b69257010a058575808160bb8633ca32af7d6bff28471ff7 |
|
See more details on using hashes here.
File details
Details for the file dissec-1.0-py3-none-any.whl
.
File metadata
-
Download URL:
dissec-1.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
-
Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.21 Linux/5.15.154+
File hashes
Hashes for dissec-1.0-py3-none-any.whl
Algorithm |
Hash digest |
|
SHA256 |
75a7216066d59a1d5443d4445591154d65b90aaeb2488e9facf7b156f1d7c36f |
|
MD5 |
7b0af6174d946b72013e3d9917b7c67d |
|
BLAKE2b-256 |
68c22b655351a7377340d5aacbda12201de2360efa047fb5a7f3b3297f2d365e |
|
See more details on using hashes here.