Performing Count Query via URL


(Matthew) #1

Hi all,

Is there any way to perform a count query via URL? I am currently running Logstash on a local instance, and I'm looking into querying the count of certain log times over a defined time interval.

That is - I want to see how many log files have been generated within the last hour by a defined host.

Is there any way to perform this request through a URL? I have tried something along the lines of 'http://localhost:9200/logstash*/_count?q=timestamp:24h-now' without much success.

Thanks in advance! :smile:


(Dan Tuffery) #2

Yes, use the search_type parameter with the value set to count.

 http://localhost:9200/logstash*/_search?search_type=count&q=timestamp:24h-now

(system) #3