elblog2dict


Nameelblog2dict JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/leemhoon00/elblog2dict
SummaryUtility for parsing and extracting data from ELB logs
upload_time2023-09-03 10:41:38
maintainer
docs_urlNone
authorleemhoon00
requires_python>=3.6
licenseMIT
keywords elb log parser elblog2dict regular expression
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ELBLOG2DICT

## Description

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

## Installation

```bash
pip install elblog2dict
```

## Usage

```python
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

```json
{
  "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.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/leemhoon00/elblog2dict",
    "name": "elblog2dict",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "elb,log,parser,elblog2dict,regular expression",
    "author": "leemhoon00",
    "author_email": "leemhoon000@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/92/5f/dfffbb20460e76b966c7fba82fcdff5a964ddcfbef286997adb8fa0e7d43/elblog2dict-1.0.1.tar.gz",
    "platform": null,
    "description": "# ELBLOG2DICT\n\n## Description\n\nThis module converts Amazon ELB traffic logs into a python dictionary format.\n\n## Installation\n\n```bash\npip install elblog2dict\n```\n\n## Usage\n\n```python\nfrom elblog2dict import parser\nimport gzip\n\nfile_path = 'log1.log.gz'\nwith gzip.open(file_path, 'rb') as f:\n    data = f.read()\n\nextracted_data = parser.parse(data)\n\nfor data in extracted_data:\n    print(data)\n\n```\n\n## Output\n\n```json\n{\n  \"type\": \"http\",\n  \"timestamp\": \"2023-06-19T01:24:36.560391Z\",\n  \"elb\": \"app/crawling-ALB/df7b42c830cab31c\",\n  \"client_ip\": \"185.254.196.173\",\n  \"clent_port\": \"55646\",\n  \"target_ip\": \"172.31.1.83\",\n  \"target_port\": \"80\",\n  \"request_processing_time\": \"0.012\",\n  \"target_processing_time\": \"0.001\",\n  \"response_processing_time\": \"0.000\",\n  \"elb_status_code\": \"404\",\n  \"target_status_code\": \"404\",\n  \"received_bytes\": \"231\",\n  \"sent_bytes\": \"3828\",\n  \"request_method\": \"GET\",\n  \"url\": \"http://15.165.214.35:80/.env\",\n  \"http_version\": \"HTTP/1.1\",\n  \"user_agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\",\n  \"ssl_cipher\": \"-\",\n  \"ssl_protocol\": \"-\",\n  \"target_group_arn\": \"arn:aws:elasticloadbalancing:ap-northeast-2:375350317796:targetgroup/crawling-TG/02bacd9ef5e3c0ab\",\n  \"trace_id\": \"Root=1-648fae54-2521fdf43f8d31f87fc9061b\",\n  \"domain_name\": \"-\",\n  \"chosen_cert_arn\": \"-\",\n  \"matched_rule_priority\": \"0\",\n  \"request_creation_time\": \"2023-06-19T01:24:36.547000Z\",\n  \"actions_executed\": \"waf,forward\",\n  \"redirect_url\": \"-\",\n  \"error_reason\": \"-\",\n  \"target_port_list\": \"172.31.1.83:80\",\n  \"target_status_code_list\": \"404\",\n  \"classification\": \"-\",\n  \"classification_reason\": \"-\"\n}\n\n```\n\n## License\n\nMIT License\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Utility for parsing and extracting data from ELB logs",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/leemhoon00/elblog2dict"
    },
    "split_keywords": [
        "elb",
        "log",
        "parser",
        "elblog2dict",
        "regular expression"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1826d7f7a701ce637e546c69b663ef883bbdee69fed01863d668a6044382a4f",
                "md5": "b9f7b77a6fb22e66d91deea79c4e9f59",
                "sha256": "afc77caf3636ffc993180fbe89393689271d85b2dbfb17db2146cab520d3bd41"
            },
            "downloads": -1,
            "filename": "elblog2dict-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b9f7b77a6fb22e66d91deea79c4e9f59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4377,
            "upload_time": "2023-09-03T10:41:37",
            "upload_time_iso_8601": "2023-09-03T10:41:37.185762Z",
            "url": "https://files.pythonhosted.org/packages/b1/82/6d7f7a701ce637e546c69b663ef883bbdee69fed01863d668a6044382a4f/elblog2dict-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "925fdfffbb20460e76b966c7fba82fcdff5a964ddcfbef286997adb8fa0e7d43",
                "md5": "ac6ad9c18bcaff9e6a13fd82b19f4b10",
                "sha256": "b4b80ecea78f4b7e25f16d36f2e44ac934fecf4e5075d68864fcf2b4ed66241e"
            },
            "downloads": -1,
            "filename": "elblog2dict-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ac6ad9c18bcaff9e6a13fd82b19f4b10",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3577,
            "upload_time": "2023-09-03T10:41:38",
            "upload_time_iso_8601": "2023-09-03T10:41:38.846221Z",
            "url": "https://files.pythonhosted.org/packages/92/5f/dfffbb20460e76b966c7fba82fcdff5a964ddcfbef286997adb8fa0e7d43/elblog2dict-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-03 10:41:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "leemhoon00",
    "github_project": "elblog2dict",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "elblog2dict"
}
        
Elapsed time: 0.10619s