# Visualization - Group IP Addresses by /24 Subnet

**URL:** <https://discuss.elastic.co/t/visualization-group-ip-addresses-by-24-subnet/66487>\
**Category:** Kibana\
**Created:** [November 18, 2016, 7:07am UTC](https://discuss.elastic.co/t/visualization-group-ip-addresses-by-24-subnet/66487 "2016-11-18T07:07:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamkelvinloke](https://avatars.discourse-cdn.com/v4/letter/i/e480ec/32.png) [@iamkelvinloke](https://discuss.elastic.co/u/iamkelvinloke)\
**Post date:** [November 18, 2016, 7:07am UTC](https://discuss.elastic.co/t/visualization-group-ip-addresses-by-24-subnet/66487/1 "2016-11-18T07:07:22Z")

</div>

Happy in using Elastic Stack 5 with Ingest mode (Filebeat) now 🙂

I have a visualization (Data Table) to show all the source IP count to visit my web server.

clientip: Ascending Count  
1.10.100.151 1000  
1.10.100.152 1000  
1.10.101.153 500  
1.10.101.153 200  
1.10.200.160 30  
1.164.10.238 10

How can I group them by /24 subnet to become the list like below?

clientip: Ascending Count  
1.10.100.0/24 2000  
1.10.101.0/24 1000  
1.10.200.0/24 30  
1.164.10.0/24 10

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [November 20, 2016, 8:26pm UTC](https://discuss.elastic.co/t/visualization-group-ip-addresses-by-24-subnet/66487/2 "2016-11-20T20:26:22Z")

</div>

Elasticsearch allows you to create [aggregation buckets](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-iprange-aggregation.html), including using a CIDR mask but it doesn't appear you can do it automatically. You might be able to create a custom [tokenizer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html) to accomplish this.

---

<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:** [December 18, 2016, 8:26pm UTC](https://discuss.elastic.co/t/visualization-group-ip-addresses-by-24-subnet/66487/3 "2016-12-18T20:26:48Z")

</div>

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