query-loki-project-logs — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited query-loki-project-logs (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill to inspect Loki logs with the house convention:
project_name identifies the service or deployment and usually matches the git repository nameenv identifies the deployment environment such as dev, test, or prodfilename identifies the concrete stream, such as pd_router-web-stderr.log or pd_router-nginx-stdout.logThe helper script is compatible with both:
project_nameprojectIt auto-detects the project label unless --project-label or LOKI_PROJECT_LABEL is set.
If the user prefers dashboards over CLI triage, Grafana dashboards can use the same labels and keywords:
project_name or projectenvfilenamefilename values.Prefer the helper script first:
export LOKI_ADDR="https://your-loki.example.com"
export LOKI_USERNAME="your-basic-auth-user"
export LOKI_PASSWORD="your-basic-auth-password"
python3 scripts/loki_project_logs.py projects --since 720h
python3 scripts/loki_project_logs.py envs --since 720h
python3 scripts/loki_project_logs.py files --project pdrouter --env test --since 24h
python3 scripts/loki_project_logs.py errors --project pdrouter --env test --component web --since 1hRun these commands from the skill root directory.
The errors subcommand narrows to matching stderr streams by default. When errors or query --component ... cannot find a filename inside the exact query window, the helper falls back to a 24h discovery window so quiet streams such as nginx stderr are still discoverable. The helper also escapes --grep and --regex strings for LogQL, so patterns containing quotes or backslashes are safer to pass through the CLI.
If the script is not appropriate, use raw logcli commands from references/query-patterns.md.
Prefer LOKI_ADDR from the current environment. For deployments behind BasicAuth, also prefer LOKI_USERNAME and LOKI_PASSWORD. If they are missing, the helper checks common shell config files such as ~/.zshrc for export LOKI_ADDR=.... Do not assume http://localhost:3100 is correct unless the user confirms it.
List project label values before guessing names. This gives the set of known deployments in Loki for the chosen lookback window. In the current internal convention, the project value usually matches the git repository name.
If the user did not specify the environment, list env values first. Common values include dev, test, and prod.
List filename values for the chosen project and environment. Use the filename to distinguish the stream type:
*-web-stderr.log: application errors and Python tracebacks*-web-stdout.log: application request and info logs*-worker-stderr.log: worker exceptions*-worker-stdout.log: worker info logs*-nginx-stderr.log: nginx errors*-nginx-stdout.log: access logs or proxy outputinit.log: startup outputUse exact filenames when querying once the right stream is known.
When the user asks whether there are errors:
stderr for the requested component.ERROR, Exception, Traceback, panic, sqlalchemy.exc, and asyncpg.exceptions.If the request is about web issues, check both:
*-web-stderr.log for exceptions*-web-stdout.log for the request path or surrounding request logsIf the request is about nginx, include both nginx streams because routing failures often show up in stdout access logs while configuration issues show up in stderr.
When answering the user, include:
Avoid claiming absence of errors unless you checked the relevant stream for the requested component.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.