I've set up a rule
SELECT * FROM '$aws/things/+/shadow/update/accepted'
This rule triggers my lambda function when the shadow of any thing in my AWS IoT updates.
Instead I want it to get triggered only when the shadows of some things are updated, not all of them. Any way I can do that?
I recently learned that you can use functions to filter on parts of the topic, and something like this could potentially work for you:
SELECT *
FROM '$aws/things/+/shadow/update/accepted'
WHERE startswith(topic(3), 'someprefix-')
This would only trigger the action(s) when the part of the topic captured by the + started with "someprefix-". You can use other functions to filter in other ways if a prefix does not work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With