aws iot list-things, filtering by attribute-name and attribute-value


I am trying to find an iot Thing in my registry before doing some other logic.
All the things have an attribute "Serial", so I tried this command:

aws iot list-things --attribute-name "Serial" --attribute-value "1234"

And it doesn't find anything:

    "things": []

If I try it without any filters:

aws iot list-things

I see the Thing with the attributes, including Serial = 1234

    "things": [
            "thingName": "test123",
            "thingTypeName": "Tablet",
            "thingArn": "arn:aws:iot:us-west-2:***********:thing/test123",
            "attributes": {
                "Serial": "1234"
            "version": 1

I even tried aws iot list-things --attribute-name "Serial" and still nothing comes back.

What am I missing?

asked 3 years ago32 views
1 Answer

Hi omora,

I see your thing has an associated thing type named Tablet. Is the Serial attribute defined by the Tablet thing type? The only searchable/filterable attributes in the ListThings API are those defined by your thing type (or the 3 attributes you get by default when no thing type is associated).


answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions