# Performing Count Query via URL

**URL:** <https://discuss.elastic.co/t/performing-count-query-via-url/2727>\
**Category:** Elasticsearch\
**Created:** [June 15, 2015, 7:21pm UTC](https://discuss.elastic.co/t/performing-count-query-via-url/2727 "2015-06-15T19:21:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mcg](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@Mcg](https://discuss.elastic.co/u/Mcg)\
**Post date:** [June 15, 2015, 7:21pm UTC](https://discuss.elastic.co/t/performing-count-query-via-url/2727/1 "2015-06-15T19:21:24Z")

</div>

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](http://localhost:9200/logstash*/_count?q=timestamp:24h-now)' without much success.

Thanks in advance! 😄

---

<div class="post-metadata">

**Author:** ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)\
**Post date:** [June 16, 2015, 6:51am UTC](https://discuss.elastic.co/t/performing-count-query-via-url/2727/2 "2015-06-16T06:51:55Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:07am UTC](https://discuss.elastic.co/t/performing-count-query-via-url/2727/3 "2017-07-06T00:07:16Z")

</div>


