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.
Metadata
Release files for dissec 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dissec-1.2.tar.gz | 16.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dissec-1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.4 kB
Release files / dissec-1.2.tar.gz
| Download URL | dissec-1.2.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a12129d07a711ef9a874e43aa27fda320aa0d71c71136301c56d911df25257b
|
|
BLAKE2b-256 checksum How to use checksums |
4e4c0200ba1e932342a1e51fa76714472cfc979511550f4c08f43785df05cc60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / dissec-1.2-py3-none-any.whl
| Download URL | dissec-1.2-py3-none-any.whl |
|---|---|
| Size | 20.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
709a3972dc3a3f1ac6b2632ebdb18d0bb9c65efef8469c76eb655d91fc6f2999
|
|
BLAKE2b-256 checksum How to use checksums |
06e184e06424aebc5b40b9c3f1cb19d2492a47489f240e08d3c4a8fa8b1c3a1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|