Skip to main content

A powerful CLI tool for analyzing AWS CloudWatch Logs with ease

Project description

Sherlock 🔍

CLI tool for extracting AWS CloudWatch Logs locally.

Description

Sherlock is a Python-based command-line tool that helps you filter, analyze, and export AWS CloudWatch Logs. It provides an intuitive interface to search through your logs with custom filters and export them to readable formats with human-readable timestamps.

Features

  • 🔍 Filter CloudWatch Logs by time range and custom patterns
  • 📅 Convert timestamps to human-readable date formats
  • 📝 Export logs to text files with structured formatting
  • ⚡ Fast and efficient log processing
  • 🛡️ Built-in AWS authentication support

Installation

From PyPI

pip install sherlock

Configuration

Make sure you have AWS credentials configured.

Required permissions:

  • logs:FilterLogEvents
  • logs:DescribeLogGroups

Usage

sherlock --log-group "my-log-group" --start "2025-09-10T12:00:00Z" --end "2025-09-10T12:15:00Z" --region "eu-central-1" --filter-pattern "UnwantedException"

Options

Option Description Required Default
--log-group CloudWatch Log Group name Yes -
--start-time Start time for filtering (ISO8601 format) Yes -
--end-time End time for filtering (ISO8601 format) Yes -
--region End time for filtering (ISO8601 format) Yes -
--filter-pattern CloudWatch filter pattern No ""
--output Output file name No logs.txt

Time Format

Time parameters (--start-time and --end-time) must be in ISO8601 format:

  • 2025-09-10T14:30:00Z (UTC timezone)
  • 2025-09-10T14:30:00+02:00 (with timezone offset)
  • 2025-09-10T14:30:00.123Z (with milliseconds)

Output Format

The exported logs include the following columns:

  1. Timestamp - Original timestamp in milliseconds
  2. Date - Human-readable date (YYYY-MM-DD HH:MM:SS)
  3. Log Stream - CloudWatch log stream name
  4. Message - The actual log message

Example output:

1757506004044	2025-09-10 14:06:44	my-log-group/3cb6c84259584af3be92688fc6f809eb	ERROR: Application failure occurred

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Eric Villa - eric@besharp.it

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_sherlock-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_sherlock-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file aws_sherlock-0.1.1.tar.gz.

File metadata

  • Download URL: aws_sherlock-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.4.0

File hashes

Hashes for aws_sherlock-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ee5d06e385cfabfd77438227152eebb81c6f772f577c85911b6ed137945d365d
MD5 2cc1557dc9640f1068ee4251af871924
BLAKE2b-256 2859109050546b9bae0605fd0c810acc1c2f30fdd48e44c86e9fea7d7b119646

See more details on using hashes here.

File details

Details for the file aws_sherlock-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aws_sherlock-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.4.0

File hashes

Hashes for aws_sherlock-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e58c128cd0e3434998206acdd4b117a1bce24e841f4d3b54d3375ba35875d670
MD5 7739a32555e7ffb67a1002ff9ceb39c0
BLAKE2b-256 fcc2f45baa7d642cd8e081fb4dca7eaa9859576171e4c837c6901215e03c5746

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page