Skip to main content

ELBLOG2DICT

Description

This module converts Amazon ELB traffic logs into a python dictionary format.

Installation

pip install elblog2dict

Usage

from elblog2dict import parser
import gzip

file_path = 'log1.log.gz'
with gzip.open(file_path, 'rb') as f:
    data = f.read()

extracted_data = parser.parse(data)

for data in extracted_data:
    print(data)

Output

{
  "type": "http",
  "timestamp": "2023-06-19T01:24:36.560391Z",
  "elb": "app/crawling-ALB/df7b42c830cab31c",
  "client_ip": "185.254.196.173",
  "clent_port": "55646",
  "target_ip": "172.31.1.83",
  "target_port": "80",
  "request_processing_time": "0.012",
  "target_processing_time": "0.001",
  "response_processing_time": "0.000",
  "elb_status_code": "404",
  "target_status_code": "404",
  "received_bytes": "231",
  "sent_bytes": "3828",
  "request_method": "GET",
  "url": "http://15.165.214.35:80/.env",
  "http_version": "HTTP/1.1",
  "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36",
  "ssl_cipher": "-",
  "ssl_protocol": "-",
  "target_group_arn": "arn:aws:elasticloadbalancing:ap-northeast-2:375350317796:targetgroup/crawling-TG/02bacd9ef5e3c0ab",
  "trace_id": "Root=1-648fae54-2521fdf43f8d31f87fc9061b",
  "domain_name": "-",
  "chosen_cert_arn": "-",
  "matched_rule_priority": "0",
  "request_creation_time": "2023-06-19T01:24:36.547000Z",
  "actions_executed": "waf,forward",
  "redirect_url": "-",
  "error_reason": "-",
  "target_port_list": "172.31.1.83:80",
  "target_status_code_list": "404",
  "classification": "-",
  "classification_reason": "-"
}

License

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for elblog2dict 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elblog2dict 1.0.1
File Size Uploaded Provenance Actions
elblog2dict-1.0.1.tar.gz 3.6 kB Without provenance Details for elblog2dict-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for elblog2dict 1.0.1
File Interpreter ABI Platform Actions
elblog2dict-1.0.1-py3-none-any.whl Python 3 none any Details for elblog2dict-1.0.1-py3-none-any.whl

Total release size: 8.0 kB

Release files / elblog2dict-1.0.1.tar.gz

Download URL elblog2dict-1.0.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b4b80ecea78f4b7e25f16d36f2e44ac934fecf4e5075d68864fcf2b4ed66241e
BLAKE2b-256 checksum
How to use checksums
925fdfffbb20460e76b966c7fba82fcdff5a964ddcfbef286997adb8fa0e7d43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / elblog2dict-1.0.1-py3-none-any.whl

Download URL elblog2dict-1.0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afc77caf3636ffc993180fbe89393689271d85b2dbfb17db2146cab520d3bd41
BLAKE2b-256 checksum
How to use checksums
b1826d7f7a701ce637e546c69b663ef883bbdee69fed01863d668a6044382a4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for elblog2dict 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page