# Aggregating (count) by regex

**URL:** <https://discuss.elastic.co/t/aggregating-count-by-regex/238281>\
**Category:** Kibana\
**Created:** [June 23, 2020, 2:34pm UTC](https://discuss.elastic.co/t/aggregating-count-by-regex/238281 "2020-06-23T14:34:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luciano\_Borges](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luciano_borges/32/70909_2.png) [@Luciano\_Borges](https://discuss.elastic.co/u/Luciano_Borges)\
**Post date:** [June 23, 2020, 2:34pm UTC](https://discuss.elastic.co/t/aggregating-count-by-regex/238281/1 "2020-06-23T14:34:22Z")

</div>

I have some data that I'd like to do a regex of a field and then an aggregation (count)  
of the results of that regex'd field. For instance:

Data:

```
GET system/path_param/1234567/00?query_param=xpto HTTP/1.1
GET system/path_param/8901234/00?query_param=xpto HTTP/1.1
GET system/path_param/5678901/00?query_param=xpto HTTP/1.1
GET other_url/other_path_param/abcde HTTP/1.1

```

Aggregation:

```
system/path_param:3
other_url/other_path_param: 1

```

Considering that I already have the query that brings me the data, how to do this aggregation in Kibana?

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [June 24, 2020, 3:51pm UTC](https://discuss.elastic.co/t/aggregating-count-by-regex/238281/2 "2020-06-24T15:51:10Z")

</div>

Hello @Luciano_Borges -

I hope this is helpful, the problem seems similar - [Regex Search in Kibana](https://discuss.elastic.co/t/regex-search-in-kibana/97436)

---

<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 22, 2020, 3:51pm UTC](https://discuss.elastic.co/t/aggregating-count-by-regex/238281/3 "2020-07-22T15:51:12Z")

</div>

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