Skip to main content

gcp-log-hit-checker

PyPI version Python versions PyPI downloads

Checks a list of GCP Cloud Logging filter patterns and reports whether each had any hits in a configurable time window. Patterns are checked in parallel, progress is shown on stderr, and results are written to stdout.

Installation

uv tool install gcp-log-hit-checker

Or with pip:

pip install gcp-log-hit-checker

Usage

gcp-log-hit-checker <patterns-file> [--project <gcp-project-id>] [--since <duration>] [--format tsv|json] [--timeout <seconds>]
  • --project — GCP project ID, defaults to your active gcloud config project
  • --since — how far back to search; accepts m (minutes), h (hours), d (days), w (weeks). Default: 30d
  • --format — output format, tsv (default) or json
  • --timeout — timeout per pattern check in seconds. Default: 600

Patterns file

One Cloud Logging filter per line. Lines starting with # are ignored.

# Check specific endpoints
httpRequest.requestUrl=~"api/v1/.*/orders"
severity=ERROR resource.type="gce_instance"

Output

Progress and status messages are written to stderr. Results are written to stdout, making it safe to redirect to a file:

gcp-log-hit-checker patterns.txt > results.tsv
gcp-log-hit-checker --format json patterns.txt > results.json

TSV

Tab-separated columns: <emoji>\t<pattern>\t<last-hit-timestamp>\t<entry-link>\t<filter-link>

✅	httpRequest.requestUrl=~"api/v1/.*/orders"	2026-01-15 10:23:45+00:00	https://console.cloud.google.com/...	https://console.cloud.google.com/...
❌	severity=ERROR resource.type="gce_instance"			https://console.cloud.google.com/...

JSON

[
  {
    "pattern": "httpRequest.requestUrl=~\"api/v1/.*/orders\"",
    "status": "hit",
    "timestamp": "2026-01-15 10:23:45+00:00",
    "entry_link": "https://console.cloud.google.com/logs/query;query=insertId%3D%22abc123%22?project=my-project",
    "filter_link": "https://console.cloud.google.com/logs/query;query=...;duration=P30D?project=my-project"
  },
  {
    "pattern": "severity=ERROR resource.type=\"gce_instance\"",
    "status": "no_hit",
    "timestamp": null,
    "entry_link": null,
    "filter_link": "https://console.cloud.google.com/logs/query;query=...;duration=P30D?project=my-project"
  }
]

Possible status values: hit, no_hit, error, cancelled (interrupted before check ran).

Ctrl+C prints a partial summary of completed checks before exiting.

Release files for gcp-log-hit-checker 0.1.4

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

Source distribution (sdist)

Source distribution for gcp-log-hit-checker 0.1.4
File Size Uploaded
gcp_log_hit_checker-0.1.4.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcp-log-hit-checker 0.1.4
File Interpreter ABI Platform
gcp_log_hit_checker-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / gcp_log_hit_checker-0.1.4.tar.gz

Download URL gcp_log_hit_checker-0.1.4.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
92979c997650fc9421ab64c2ec60e69274f10e19d66e3e2e849e2e3b3642a8f0
BLAKE2b-256 checksum
How to use checksums
46c424a85f76681443bbe758f4a4dc04c8b09241ed4f0f0f3e68a381051c6746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gcp_log_hit_checker-0.1.4-py3-none-any.whl

Download URL gcp_log_hit_checker-0.1.4-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf42a3e8107272dec7e4d005fe04ac18d83e52f54e06855d5b51231e87bb99b4
BLAKE2b-256 checksum
How to use checksums
72e7297ba4c2b606473ac6ed31752a91e15f62a59af82a3813fdd374826a0740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

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