Skip to content

Instantly share code, notes, and snippets.

@slattery
Forked from dsmrt/query-aws-logs-insights.bash
Created February 6, 2022 18:12
Show Gist options
  • Save slattery/4f89d2484caa27242c1c84a9acb75263 to your computer and use it in GitHub Desktop.
Save slattery/4f89d2484caa27242c1c84a9acb75263 to your computer and use it in GitHub Desktop.
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
aws logs start-query \
--profile clientProfile \
--log-group-name MY-LOG_GROUP \
--start-time `date -v-30M "+%s"` \
--end-time `date "+%s"` \
--query-string 'fields @message | filter @message like /my query/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment