| Server IP : 138.197.107.151 / Your IP : 216.73.216.170 Web Server : Apache/2.4.58 (Ubuntu) System : Linux BloxBy-Builder 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : wpbetasites_mrakzqskir ( 1022) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/bsd-crawler-parser/aws/dist/awscli/examples/iot/ |
Upload File : |
**To create a custom metric published by your devices to Device Defender**
The following ``create-custom-metric`` example creates a custom metric that measures battery percentage. ::
aws iot create-custom-metric \
--metric-name "batteryPercentage" \
--metric-type "number" \
--display-name "Remaining battery percentage." \
--region us-east-1 \
--client-request-token "02ccb92b-33e8-4dfa-a0c1-35b181ed26b0"
Output::
{
"metricName": "batteryPercentage",
"metricArn": "arn:aws:iot:us-east-1:1234564789012:custommetric/batteryPercentage"
}
For more information, see `Custom metrics <https://docs.aws.amazon.com/iot/latest/developerguide/dd-detect-custom-metrics.html>`__ in the *AWS IoT Core Developer Guide*.