

# Metrics export schema
<a name="metrics-export-json-schema"></a>

See the following schema for batched metrics export data.

```
{
 "version": "1.0",
 "metrics": [
 {
 "name": "{metricName}",
 "thing": "{thingName}",
 "value": {
 # a list of Classless Inter-Domain Routings (CIDR) specifying metric 
# source-ip-address and destination-ip-address
 "cidrs": ["string"], 
 # a single metric value for cloud/device metrics
 "count": number,
 # a single metric value for custom metric
 "number": number,
 # a list of numbers for custom metrics
 "numbers": [number],
 # a list of ports for cloud/device metrics
 "ports": [number],
 # a list of strings for custom metrics
 "strings": ["string"]
 },
 # In some rare cases we may send multiple values for the same thing, metric and timestamp. 
 # When there are multiple values, please use the value with highest version number 
 # and discard other values.
 "version": number,
 # For cloud-side metrics, this is the time when Amazon IoT Device Defender Detect aggregates the
 # metrics data received from Amazon IoT.
 # For device-side and custom metrics, this is the time at which the metrics data
 # is reported by the devices.
 "timestamp": number,
 # The dimension parameters are optional. It's set only if
 # the metrics are configured with a dimension in the security profile.
 "dimension": {
 "name": "{dimensionName}",
 "operator": "{dimensionOperator}"
 }
 }
 ]
}
```