{"id":13448208,"url":"https://github.com/dogoncouch/logdissect","last_synced_at":"2025-04-10T04:59:57.444Z","repository":{"id":45229468,"uuid":"82487586","full_name":"dogoncouch/logdissect","owner":"dogoncouch","description":"CLI utility and Python module for analyzing log files and other data.","archived":false,"fork":false,"pushed_at":"2021-02-08T18:11:23.000Z","size":669,"stargazers_count":138,"open_issues_count":3,"forks_count":22,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-23T06:43:06.238Z","etag":null,"topics":["cli","command-line","data-analysis","data-science","forensic-analysis","forensics","json","library","log-analysis","log-parser","module","parser","parsing","parsing-library","python-library","python-module","python-modules","security","syslog"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dogoncouch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-19T20:31:46.000Z","updated_at":"2024-05-07T20:16:06.000Z","dependencies_parsed_at":"2022-08-31T13:55:10.294Z","dependency_job_id":null,"html_url":"https://github.com/dogoncouch/logdissect","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogoncouch%2Flogdissect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogoncouch%2Flogdissect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogoncouch%2Flogdissect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogoncouch%2Flogdissect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dogoncouch","download_url":"https://codeload.github.com/dogoncouch/logdissect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161267,"owners_count":21057554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","data-analysis","data-science","forensic-analysis","forensics","json","library","log-analysis","log-parser","module","parser","parsing","parsing-library","python-library","python-module","python-modules","security","syslog"],"created_at":"2024-07-31T05:01:38.849Z","updated_at":"2025-04-10T04:59:57.399Z","avatar_url":"https://github.com/dogoncouch.png","language":"Python","readme":"# logdissect\n\n## Index\n\n- [Introduction](#introduction)\n  - [Description](#description)\n  - [Installing](#installing)\n- [Usage](#usage)\n  - [Options](#options)\n  - [Parsers](#parsers)\n  - [Examples](#examples)\n  - [Notes](#notes)\n- [Community](#community)\n  - [Module](#api)\n  - [Support](#support)\n  - [Contributing](#contributing)\n- [Copyright](#copyright)\n\nFor library documentation, see the [module documentation](docs/README-MODULE.md).\n\n# Introduction\n\n## Description\nLogdissect is a CLI utility and Python library for analyzing log files and other data. It can parse, merge, filter, and export data (to log files, or JSON).\n\n![logdissect CLI screenshot](docs/images/screenshot_cli.png)\n\n## Installing\nTo install the latest release, see the latest instructions on the [releases page](https://github.com/dogoncouch/logdissect/releases). To install the development source, see the instructions in [CONTRIBUTING.md](docs/CONTRIBUTING.md#installing-development-source).\n\n# Usage\n\n## Options\n```\nusage: logdissect.py [-h] [--dhost DHOST] [--grep PATTERN] [--last LAST]\n                     [--process PROCESS] [--protocol PROTOCOL] [--range RANGE]\n                     [--utc] [--rdhost DHOST] [--rgrep PATTERN]\n                     [--rprocess PROCESS] [--rprotocol PROTOCOL]\n                     [--rshost SHOST] [--rsource SOURCE] [--shost SHOST]\n                     [--source SOURCE] [--linejson LINEJSON] [--outlog OUTLOG]\n                     [--label LABEL] [--sojson SOJSON] [--pretty] [--version]\n                     [--verbose] [-s] [--list-parsers] [-p PARSER] [-z]\n                     [-t TZONE]\n                     [file [file ...]]\n\npositional arguments:\n  file                  specify input files\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  --verbose             set verbose terminal output\n  -s                    silence terminal output\n  --list-parsers        return a list of available parsers\n  -p PARSER             select a parser (default: syslog)\n  -z, --unzip           include files compressed with gzip\n  -t TZONE              specify timezone offset to UTC (e.g. '+0500')\n\nfilter options:\n  --dhost DHOST         match a destination host\n  --grep PATTERN        match a pattern\n  --last LAST           match a preceeding time period (e.g. 5m/3h/2d/etc)\n  --process PROCESS     match a source process\n  --protocol PROTOCOL   match a protocol\n  --range RANGE         match a time range (YYYYMMDDhhmm-YYYYMMDDhhmm)\n  --utc                 use UTC for range matching\n  --rdhost DHOST        filter out a destination host\n  --rgrep PATTERN       filter out a pattern\n  --rprocess PROCESS    filter out a source process\n  --rprotocol PROTOCOL  filter out a protocol\n  --rshost SHOST        filter out a source host\n  --rsource SOURCE      filter out a log source\n  --shost SHOST         match a source host\n  --source SOURCE       match a log source\n\noutput options:\n  --linejson LINEJSON   set the output file for line by line JSON output\n  --outlog OUTLOG       set the output file for standard log output\n  --label LABEL         set label type for OUTLOG (fname|fpath)\n  --sojson SOJSON       set the output file for single object JSON output\n  --pretty              use pretty formatting for sojson output\n```\n\n## Parsers\nOutput of `--list-parsers` option:\n```\n==== Available parsing modules: ====\n\nciscoios        : cisco ios parsing module\nemerge          : gentoo emerge log parsing module\nlinejson        : logdissect object-per-line JSON parsing module\nsojson          : logdissect single object JSON parsing module\nsyslog          : syslog (standard timestamp) parsing module\nsyslogiso       : syslog (ISO timestamp) parsing module\nsyslognohost    : syslog (standard timestamp, no host) parsing module\ntcpdump         : tcpdump terminal output parsing module\nwebaccess       : web access log parsing module\nwindowsrsyslog  : windows rsyslog agent log parsing module\n```\n\n## Examples\n    \n    logdissect --last 10m auth.log\n    logdissect --last 1h --process systemd --process CRON messages\n    logdissect -v --range 20160202020202-20170227213200 --label fpath messages debug apache2/error.log\n    logdissect -s --outlog myaccess.log --grep 192.168.1.56 --last 30d --label fname /var/log/apache2/access.log /var/log/apache2/other_vhosts_access.log\n\n## Notes\n1. metadata: logdissect uses file modification times to assign years to syslog date stamps. This allows it to parse logs that span more than one year without a problem. If you are copying log files, always use `` cp -p `` (or `` cp --preserve=timestamps `` ) and `` scp -p `` to preserve original mtimes and other file metadata.\n\n2. Re-parsing: If you are planning on parsing an output file back into logdissect at some point, using JSON is highly recommended. The JSON output modules use date stamps that include a year. Re-parsing a standard log output file will cause problems if the file has a different mtime than the original logs.\n\n3. --range shortcuts: The range module will fill in your ranges with zeroes if they are shorter than 14 characters. If you want to get a range of 20170204120000 to 20170204130000, you can save time and use 2017020412 and 2017020413.\n\n4. --last options: The last option should be a number followed by either 's' for seconds, 'm' for minutes, 'h' for hours, or 'd' for days (e.g. --last=20m).\n\n5. Multiple options: All non-time-based filters can be used more than once.\n\n# Community\n\n## Module\nlogdissect 2.0 and above provides a stable module for parsing log lines and files. For more information on library usage, see the [module documentation](docs/README-MODULE.md).\n\n## Support\nBugs, questions, and other issues can be directed to the project's [issues page](https://github.com/dogoncouch/logdissect/issues) on GitHub, or emailed to [dpersonsdev@gmail.com](mailto:dpersonsdev@gmail.com).\n\n## Contributing\nContributions are welcome in the form of code, bug fixes, or testing feedback. For more on how to contribute to logdissect, see the [code of conduct](docs/CODE_OF_CONDUCT.md) and [contributing guielines](docs/CONTRIBUTING.md).\n\n\n# Copyright\nMIT License\n\nCopyright (c) 2017 Dan Persons (dpersonsdev@gmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":["Python","IR Tools Collection","Endpoint","IR tools Collection","System Utilities"],"sub_categories":["Log Analysis Tools","Forensics","Directory Navigation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogoncouch%2Flogdissect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogoncouch%2Flogdissect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogoncouch%2Flogdissect/lists"}