List and delete old Kafka topics in Lenses

We want to delete topics that are no longer being used and no producer has published for a long time.

Is it possible to list all topics in Lenses that have very old data and then delete them?

Or otherwise just sort all Kafka topics based on timestamp of the events?

It’s possible to filter by empty topics but currently not possible to see/list old topics.

You could do this maybe with the Lenses CLI which queries the first event in each topic and gets the timestamp. Such as:


topics=`./lenses-cli topics | awk 'NR>2 {print $1}'`
for topic in $topics
  echo $topic `./lenses-cli query "SELECT _meta.timestamp as ts FROM $topic LIMIT 1" | jq .ts`


This solution only relevant if the timestamp is the Ingestion time of the event.