Table: aws_iot_fleet_metric - Query AWS IoT Fleet Metrics using SQL
AWS IoT Fleet Metrics, part of AWS IoT Device Management, allows for the monitoring and management of the status and performance of your IoT device fleet. It enables the definition of custom metrics based on device data reported to AWS IoT Core, such as device states or telemetry data. These metrics are instrumental in providing insights into various aspects of your IoT fleet, aiding in decisions related to device maintenance, operations, and performance optimization.
Table Usage Guide
The aws_iot_fleet_metric
table can be utilized to access detailed information about custom metrics defined for IoT device fleets. This table is essential for IoT administrators and analysts who need to oversee fleet performance, status, and operational metrics within AWS.
Examples
Basic info
Retrieve fundamental details about AWS IoT Fleet Metrics, including metric names, associated ARNs, index names, and dates of creation and modification.
select metric_name, arn, index_name, creation_date, last_modified_datefrom aws_iot_fleet_metric;
select metric_name, arn, index_name, creation_date, last_modified_datefrom aws_iot_fleet_metric;
Group fleet metrics by aggregation type name
Group fleet metrics by their aggregation type name. This query is useful for analyzing metrics across different aggregation types, providing a broader view of fleet data categorization.
select metric_name, aggregation_field, creation_date, aggregation_type_name, query_stringfrom aws_iot_fleet_metricgroup by aggregation_type_name;
select metric_name, aggregation_field, creation_date, aggregation_type_name, query_stringfrom aws_iot_fleet_metricgroup by aggregation_type_name;
List fleet metrics updated in the last 30 days
Find fleet metrics that have been updated within the last 30 days. This query assists in identifying recent changes or updates in fleet metric configurations.
select metric_name, index_name, creation_date, last_modified_date, query_version, versionfrom aws_iot_fleet_metricwhere last_modified_date >= now() - interval '30 days';
select metric_name, index_name, creation_date, last_modified_date, query_version, versionfrom aws_iot_fleet_metricwhere datetime(last_modified_date) >= datetime('now', '-30 days');
Schema for aws_iot_fleet_metric
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
aggregation_field | text | The field to aggregate. | |
aggregation_type_name | text | The name of the aggregation type. | |
aggregation_type_values | jsonb | A list of the values of aggregation types. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The ARN of the fleet metric to describe. | |
creation_date | timestamp with time zone | The date when the fleet metric is created. | |
description | text | The fleet metric description. | |
index_name | text | The name of the index to search. | |
last_modified_date | timestamp with time zone | The date when the fleet metric is last modified. | |
metric_name | text | = | The name of the fleet metric to describe. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
period | bigint | The time in seconds between fleet metric emissions. Range [60(1 min), 86400(1 day)] and must be multiple of 60. | |
query_string | text | The search query string. | |
query_version | text | The search query version. | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags currently associated with the thing type. | |
title | text | Title of the resource. | |
unit | text | Used to support unit transformation such as milliseconds to seconds. The unit must be supported by CW metric (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html) | |
version | bigint | The version of the fleet metric. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_iot_fleet_metric