Skip to main content

metric_values

Creates, updates, deletes, gets or lists a metric_values resource.

Overview

Namemetric_values
TypeResource
Idaws.iot.metric_values

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
timestampstring (date-time)The time the metric value was reported.
valueobjectThe value reported for the metric.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_metric_valuesselectthingName, metricName, startTime, endTime, regiondimensionName, dimensionValueOperator, maxResults, nextTokenLists the values reported for an IoT Device Defender metric (device-side metric, cloud-side metric, or custom metric) by the given thing during the specified time period.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endTimestring (date-time)The end of the time period for which metric values are returned.
metricNamestringThe name of the security profile metric for which values are returned.
regionstringAWS region (default: us-east-1)
startTimestring (date-time)The start of the time period for which metric values are returned.
thingNamestringThe name of the thing for which security profile metric values are returned.
dimensionNamestringThe dimension name.
dimensionValueOperatorstringThe dimension value operator.
maxResultsintegerThe maximum number of results to return at one time.
nextTokenstringThe token for the next set of results.

SELECT examples

Lists the values reported for an IoT Device Defender metric (device-side metric, cloud-side metric, or custom metric) by the given thing during the specified time period.

SELECT
timestamp,
value
FROM aws.iot.metric_values
WHERE thingName = '{{ thingName }}' -- required
AND metricName = '{{ metricName }}' -- required
AND startTime = '{{ startTime }}' -- required
AND endTime = '{{ endTime }}' -- required
AND region = '{{ region }}' -- required
AND dimensionName = '{{ dimensionName }}'
AND dimensionValueOperator = '{{ dimensionValueOperator }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;