# How to count exact unique APM transactions

**URL:** <https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [March 7, 2022, 10:31am UTC](https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949 "2022-03-07T10:31:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZZ.IT](https://avatars.discourse-cdn.com/v4/letter/z/b38774/32.png) [@ZZ.IT](https://discuss.elastic.co/u/ZZ.IT)\
**Post date:** [March 7, 2022, 10:31am UTC](https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949/1 "2022-03-07T10:31:04Z")

</div>

We are using ELK stack on windows server 2016. ELK stack has version 7.16.2.

I want to count the number of transactions on this URL. I don't know if its possible.

its because we want to know how many times this link was visited.  
Any help would be appreciated. Thanks

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/f/cf617a8ef57d3f89b499a39d26121330a2d4e409.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/3/537fe6a36374f55ca66c668e9f5b62d8064490e4.png)

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [March 7, 2022, 1:18pm UTC](https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949/2 "2022-03-07T13:18:07Z")

</div>

Since transactions are stored in indices that match the pattern `apm-*-transaction`, you'd be able to do a count on this to get the number of transactions with the given name

```json
GET apm-*-transaction/_count
{
  "query": {
    "term": {
      "transaction.name": {
        "value": "GET /mit/<blank>lagger/"
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![ZZ.IT](https://avatars.discourse-cdn.com/v4/letter/z/b38774/32.png) [@ZZ.IT](https://discuss.elastic.co/u/ZZ.IT)\
**Post date:** [March 8, 2022, 7:50am UTC](https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949/3 "2022-03-08T07:50:42Z")

</div>

Thanks a lot.  
I got following result:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/4/5413f032803b0d2d23fa02cf1f8caf96711c0c3a.png)

Is it possible to select date e.g one month / or 1 week. And also only from Prod environment.

I have tried using visualization in Analytics -\> Discover and it seems to be working. Ofcourse it would be nice to also know how to get the same result via query

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [March 8, 2022, 9:32am UTC](https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949/4 "2022-03-08T09:32:38Z")

</div>

Did you change the value for `transaction.name`, to match your screenshot?

You can set a time range by combining a `range` query with the `term` query, as filter clauses in a `bool` query.

---

<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:** [March 29, 2022, 5:32am UTC](https://discuss.elastic.co/t/how-to-count-exact-unique-apm-transactions/298949/5 "2022-03-29T05:32:50Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
