aws-logs-query

Query AWS CloudWatch logs for staging and production environments to diagnose errors.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/cncorp/arsenal --skill aws-logs-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-logs-query
Source: https://github.com/cncorp/arsenal/tree/main/dot-claude/skills/aws-logs-query
Command: npx skills add https://github.com/cncorp/arsenal --skill aws-logs-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a practical guide to querying AWS CloudWatch logs for staging and production environments, enabling you to debug errors, investigate incidents, and monitor application behavior using the AWS CLI.

Core Features & Use Cases

  • Real-time log tailing: tail logs from common log groups like /ecs/codel-staging and /ecs/codel-prod.
  • Pattern searches: filter for error and exception patterns to quickly surface issues.
  • Tooling guidance: when to use CloudWatch Insights for historical searches vs. real-time tailing.

Quick Start

  1. Ensure AWS CLI is installed and credentials are configured (AWS_PROFILE or environment vars).
  2. For real-time monitoring, tail logs:
    • aws logs tail "/ecs/codel-staging" --follow --format short
    • aws logs tail "/ecs/codel-prod" --follow --format short
  3. For quick error checks, tail and grep for patterns:
    • aws logs tail "/ecs/codel-staging" --format short | grep -iE "error|exception"

Frequently Asked Questions about aws-logs-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query AWS CloudWatch logs from the command line?

Query CloudWatch logs using the AWS CLI with `aws logs tail` for real-time monitoring or `aws logs filter-log-events` for historical searches. Specify the log group name, apply filters for patterns, and use `--follow` to stream live logs from staging or production environments.

What's the fastest way to find errors in CloudWatch logs?

Tail logs in real time and pipe to grep for pattern matching: `aws logs tail "/ecs/codel-staging" --format short | grep -iE "error|exception"`. For historical error searches across large time windows, use CloudWatch Insights queries to filter and analyze logs efficiently.

Do I need AWS credentials configured to query CloudWatch logs?

Yes. The AWS CLI requires valid credentials configured via environment variables, AWS profiles, or credential files. Specify `--profile` if using a non-default profile; ensure your credentials have log group read access for the staging or production environments you query.

How do I monitor production logs in real time without manual polling?

Use `aws logs tail` with the `--follow` flag to stream logs continuously from production log groups. The command maintains an open connection and displays new log entries as they arrive, enabling real-time incident response and behavior monitoring.

When should I use CloudWatch Insights instead of tailing logs?

Use CloudWatch Insights for querying historical log data across extended time windows, analyzing patterns over hours or days, and running aggregations. Use tail for real-time monitoring and quick spot-checks of current application behavior.

Can I search for specific events or patterns across multiple log groups?

Yes. Tail individual log groups and filter output with grep for pattern searches, or use CloudWatch Insights queries to search across multiple log groups simultaneously and identify error patterns, exceptions, or specific events in staging and production environments.