How to get the number of ingested rows using sql

The documentation states that a count aggregator at ingestion time can be used to count the number of events ingested. I added one to the ingestion spec as suggested:
“metricsSpec” : [
{
“name” : “count”,
“type” : “count”
}

Now I am trying to get the number of ingested rows using sql :

SELECT __time, host, SUM(COUNT (totalPercentage) ) FROM explorer

But I get an error:
Aggregate expressions cannot be nested

I’ve been struggling with this for a while, is there a way to get the number of ingested rows using sql? What am I doing wrong?

Hi Haiku Star,

Try:

SELECT __time, host, SUM(“count”) FROM explorer GROUP BY __time, host

Thanks Gian! That was most helpful and solved my problem.