HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/awscli/examples/iotanalytics/sample-channel-data.rst
**To retrieve sample messages from a channel**

The following ``sample-channel-data`` example retrieves a sample of messages from the specified channel ingested during the specified timeframe. You can retrieve up to 10 messages. ::

    aws iotanalytics sample-channel-data \
        --channel-name mychannel

Output::

    {
        "payloads": [
            "eyAidGVtcGVyYXR1cmUiOiAyMCB9",
            "eyAiZm9vIjogImJhciIgfQ=="
        ]
    }

For more information, see `SampleChannelData <https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_SampleChannelData.html>`__ in the *AWS IoT Analytics API Reference*.