Count log entries over a specified period in Loki Explore workspace

Hi – What is the best way to count all log entries over a specified period of time that matches a given LogQL query?

To provide some context, when using Solarwind’s Loggly service, you can get an exact count of log entries that match a given search query over some period of time. You can see an example of this in the Loggly documentation (see Loggly | Search Overview). Is there an equivalent to doing this in Loki?

Using something like sum(count_over_time(<query>[<time range>])) by (<something>) just graphs over a limited time range.

Basically I’m looking for an equivalent way of doing grep -c in the Loki Explore workspace.

Thanks in advance.