Overview of active topics in IoT Core

0

I'm trying to find a list of active topics in our account. During testing it's very difficult to understand what devices are publishing to which topics and how often. Worse, a device could be publishing to a random topic and could be billing for messages we can't find.

It's a feature we've used heavily in other MQTT brokers like EMQX & HiveMQ.

I think it would be a very useful feature to have a topic overview where all topics recently used in the broker are listed along with their volume of use. This would be especially useful for debugging topics when trying to define an application-wide topic schema.

Perhaps there is a way to do this already?

preguntada hace 2 años270 visualizaciones
1 Respuesta
1
Respuesta aceptada

Hi. One way is to enable AWS ioT Logging. Then use CloudWatch Logs Insights to query the AWSioTLogsV2 log group with a query like this (over whatever timeframe you want to check):

fields @timestamp, @message
| filter eventType = 'Publish-In'
| stats count(*) by topicName

This will give you a list of every topic during that timeframe and the number of messages published to each topic.

profile pictureAWS
EXPERTO
Greg_B
respondido hace 2 años
profile picture
EXPERTO
revisado hace 9 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas