Docs
  • LogicLoop Documentation
  • LogicLoop Quickstart
  • Data Sources
    • Connect your data source
      • Deployment options
    • Supported data sources
      • API data (JSON)
      • AWS CloudWatch
      • BigQuery
      • Databricks
      • Google Analytics
      • Google Sheets
      • MongoDB
      • Microsoft SQL Server
      • MySQL
      • Oracle
      • PostgreSQL
      • Snowflake
      • Combine Results
      • LogicLoop Data Source
  • Queries
    • Write a rule
      • More rule options
      • A/B testing rules
      • Version history
      • Query Snippets
    • Visualizations & dashboards
      • Visualizations
      • Dashboards
  • Actions
    • Set up an action
    • Action destinations
      • Email
      • Slack
      • Webhooks & APIs
      • Microsoft Teams
      • Salesforce
      • Zapier
      • PagerDuty
      • Write to Database
      • Chain Rules
      • Google Sheets
      • Bento
    • Templating
  • Case Management
    • Case Management
      • Ticket Generation
      • Case Triage
      • Custom Fields and Attachments
  • AI
    • AI Query Helper
    • Ask AI
  • Teams & Settings
    • Integrations
      • Slack
      • Google Sheets
    • Invite your teammate
    • Groups & Permissions
  • Changelog
  • FAQs
  • Troubleshooting
  • Templates
    • Templates Home
    • Risk & Fraud Rules
    • AML Transaction Monitoring Rules
    • Logistics & Marketplace Ops
    • Customer Success & Growth
    • Systems Observability
    • Data Quality Monitoring
    • Healthcare
    • HTML Email Templates
      • Annual Review
      • Weekly Performance Table
      • Invoice Recap
  • BETA
    • AI SQL API
    • Approving rules
    • Render Data as JSON
    • Case Analytics
    • Python
  • Security & Legal
    • Security
    • AI Security
    • Terms of use
    • Privacy policy
    • Services description
Powered by GitBook
On this page
  • Prerequisites
  • Setup
  • Querying CloudWatch
  • Querying CloudWatch Logs Insights

Was this helpful?

  1. Data Sources
  2. Supported data sources

AWS CloudWatch

PreviousAPI data (JSON)NextBigQuery

Last updated 1 year ago

Was this helpful?

Prerequisites

Setup

LogicLoop connects to CloudWatch using the boto3 client. According to their before you can query with LogicLoop:

[Y]ou should set up authentication credentials. Credentials for your AWS account can be found in the IAM Console. You can create or use an existing user. Go to manage access keys and generate a new set of keys.

With your access_key_id and secret_access_key you can set up the CloudWatch and CloudWatch Log Insights data sources.

Querying CloudWatch

These instructions assume you are familiar with the CloudWatch ad-hoc query language. To make exploring your data easier the schema browser will show which Namespaces and Metrics you can query.

Your query text must written in (not SQL). It should be an array of MetricDataQuery objects under a key called MetricsDataQueries. When you execute the query LogicLoop converts this array to one or more get_metric_data() calls.

Here’s an example that sends two MetricDataQuery objects.

MetricDataQueries: 
  - Id: database_connections
    MetricStat:
      Metric:
        Namespace: AWS/RDS
        MetricName: DatabaseConnections
      Period: 60
      Stat: Maximum
  - Id: swap_usage
    MetricStat:
      Metric:
        Namespace: AWS/RDS
        MetricName: SwapUsage
      Period: 60
      Stat: Maximum
StartTime: "2020-01-01 00:00:00"

Helpful Links

To learn more about the CloudWatch ad-hoc query language you can study the following links.

Querying CloudWatch Logs Insights

Key
Type

logGroupName

string

logGroupNames

array of strings

startTime

integer or timestring

endTime

integer or timestring

queryString

string

limit

integer

Your query must include either a logGroupName or logGroupNames. When you execute the query LogicLoop converts this object into a start_query() call. Here is an example query:

startTime: '2020-01-01 00:00'
logGroupNames: ['/ecs/rq-adhoc', '/ecs/rq-scheduled', '/ecs/rq-workers-scheduled']
queryString: 
  filter @message like 'Opened tunnel for <some org id>'
  | parse 'Opened tunnel for <some org id> (<data source id>) with port *' as port
  | fields @timestamp, @logStream
  | sort @timestamp desc

Helpful Links

To query your CloudWatch data with SQL, first pull data using the YAML syntax. Then use the datasource to filter and sort the results

These instructions assume you are familiar with the CloudWatch Logs Insights ad-hoc query language. To make exploring your data easier the schema browser will show which Log Groups and @Fields you can query. Your query text must be written in (not SQL). Your query can include the following keys:

.

allows access to LogicLoop
Deployment
admin
documentation
YAML syntax
Query Results
boto3 reference
GetMetricData API Description
MetricDataQuery Format
MetricStat Format
YAML Syntax
Query Syntax