Count API returning zero intermittely

I have a alert check on my elastic search for last 5 min count, if its zero then its send email alert.

The problem is elastic search intermittently returning zero count for last 5 min count. The curl url is

curl --header "Content-Type:application/json" -d '{"query": {"range" : {"@timestamp" : {"gte" : "now-5m", "lt" : "now"}}}}' http://<elk_ulr>/_all/_count

If hit this url continuously below are the results ....


Why i am getting some time zero and some time count. Please help me on this inconsistency.