I have an event such as "DB connection failed" in db_logs sourcetype.
I would like to get the start and end time between which the count of occurrences of "DB connection failed" exceeds 100.
So, something like-
Start Time End Time Count 9/10/2018 14:20 9/10/2018 14:58 159 9/10/2018 12:56 9/10/2018 12:58 101 9/10/2018 10:40 9/10/2018 11:10 111
Assuming that you mean "count up all minutes that have some connection failed, stop counting when there is a minute when no connections fail, and if there are more than 100 in the time that it was failing, give me those groups of events...."
You could try something like this...
your search that finds the failed events | timechart span=1m count as reccount | streamstats prev(reccount) as prevcount | where reccount>0 | streamstats count(eval(case(isnull(reccount),1,reccount==0,1))) as groupno | stats min(_time) as mintime max(_time) as maxtime sum(reccount) as reccount by groupno | where reccount >=100
...and then format your times as desired.