For the complete documentation index, see llms.txt. This page is also available as Markdown.

Filter by timestamp or offset

This page describes how to view the most recents messages in Lenses.

A popular question is "how do I see the most recent messages?" or "how do i filter for a specific date"

To skip the old events and see the most recent very fast, you need to either filter on time or offset with these filters. A list of functions is available here SQL reference

View the most recent messages

Filter by timestamp

Use the now() function to view events from the last 5 minutes:

SELECT * FROM mytopic WHERE _meta.timestamp > now() - "5m" LIMIT 100;

Other time filters are available here

Filter by offset

View the most recent 100 events :

SELECT * FROM mytopic WHERE _meta.offset >= LAST_OFFSET() - 10 LIMIT 100;

Slice from the past

Filter by timestamp

Same example with time filter :

Filter by Offset

the same logic can be applied for filtering by offset :

Example and tutorials are available here

Last updated

Was this helpful?