# Searching IP Address Range Using CIDR Mask

**URL:** https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114
**Category:** Elasticsearch
**Created:** [February 11, 2015, 9:36pm UTC](https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114 "2015-02-11T21:36:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ed\_Brown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ed_brown/32/19230_2.png) [@Ed\_Brown](https://discuss.elastic.co/u/Ed_Brown)
#### Post date: [February 11, 2015, 9:36pm UTC](https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114/1 "2015-02-11T21:36:08Z")

</div>

Hi,  
I have an ip type defined in my index mapping. I would like to search the  
IP addresses using CIDR notation. I see IP range for aggregations using  
CIDR masks, but nothing else.  
Is what I want to do currently possible?

## Thanks.

Ed Brown  
Software Architect

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [February 13, 2015, 1:41pm UTC](https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114/2 "2015-02-13T13:41:32Z")

</div>

Hi Ed,

The CIDR notation is indeed only supported on aggregations so far.

On Wed, Feb 11, 2015 at 10:36 PM, Ed Brown [edswarchitect@gmail.com](mailto:edswarchitect@gmail.com) wrote:

> Hi,  
> I have an ip type defined in my index mapping. I would like to search the  
> IP addresses using CIDR notation. I see IP range for aggregations using  
> CIDR masks, but nothing else.  
> Is what I want to do currently possible?
> 
> ## Thanks.
> 
> Ed Brown  
> Software Architect
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6j0ZOqqBY9eWRuvkfePgPWVdEwQQ8Pd\_y4-R7CpgS\_Wg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6j0ZOqqBY9eWRuvkfePgPWVdEwQQ8Pd_y4-R7CpgS_Wg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Charlie\_Hull](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charlie\_Hull](https://discuss.elastic.co/u/Charlie_Hull)
#### Post date: [February 13, 2015, 3:01pm UTC](https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114/3 "2015-02-13T15:01:21Z")

</div>

Hi Ed,

We've used ES to search for IP addresses - this post may be helpful, not  
CIDR notation but ranges at least:

> **[Searching for IP addresses in text with Elasticsearch -](https://www.flax.co.uk/blog/2014/06/03/flexible-search-of-structured-numeric-data-with-elasticsearch/)**
>
> We recently implemented a search solution for a customer using Elasticsearch. Most of their requirements were fairly standard, however they also wanted to be able to search for IP addresses embedded in the document text, using a flexible and precise...

Cheers

Charlie

On 11 February 2015 at 21:36, Ed Brown [edswarchitect@gmail.com](mailto:edswarchitect@gmail.com) wrote:

> Hi,  
> I have an ip type defined in my index mapping. I would like to search the  
> IP addresses using CIDR notation. I see IP range for aggregations using  
> CIDR masks, but nothing else.  
> Is what I want to do currently possible?
> 
> ## Thanks.
> 
> Ed Brown  
> Software Architect
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGe-MLKcO73D5doaZX4ZHF-uSWB8UmtzmGm4fUZ5fJx%3DXuMBBQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGe-MLKcO73D5doaZX4ZHF-uSWB8UmtzmGm4fUZ5fJx%3DXuMBBQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ed\_Brown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ed_brown/32/19230_2.png) [@Ed\_Brown](https://discuss.elastic.co/u/Ed_Brown)
#### Post date: [February 13, 2015, 9:13pm UTC](https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114/4 "2015-02-13T21:13:38Z")

</div>

Thanks

Ed Brown, Mobile  
Software Architect  
On Feb 13, 2015 8:41 AM, "Adrien Grand" [adrien.grand@elasticsearch.com](mailto:adrien.grand@elasticsearch.com)  
wrote:

> Hi Ed,
> 
> The CIDR notation is indeed only supported on aggregations so far.
> 
> On Wed, Feb 11, 2015 at 10:36 PM, Ed Brown [edswarchitect@gmail.com](mailto:edswarchitect@gmail.com)  
> wrote:
> 
> > Hi,  
> > I have an ip type defined in my index mapping. I would like to search the  
> > IP addresses using CIDR notation. I see IP range for aggregations using  
> > CIDR masks, but nothing else.  
> > Is what I want to do currently possible?
> > 
> > ## Thanks.
> > 
> > Ed Brown  
> > Software Architect
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c3cc3d80-cb6f-43ad-b48c-57b96006946f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/JlU6p8tj\_HM/unsubscribe](https://groups.google.com/d/topic/elasticsearch/JlU6p8tj_HM/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6j0ZOqqBY9eWRuvkfePgPWVdEwQQ8Pd\_y4-R7CpgS\_Wg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6j0ZOqqBY9eWRuvkfePgPWVdEwQQ8Pd_y4-R7CpgS_Wg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6j0ZOqqBY9eWRuvkfePgPWVdEwQQ8Pd\_y4-R7CpgS\_Wg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6j0ZOqqBY9eWRuvkfePgPWVdEwQQ8Pd_y4-R7CpgS_Wg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAAwfWzhpX6X5j65hEu8pgxj39%2Bk\_d3s6CYEQz45ZcpXjK-JO0g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAAwfWzhpX6X5j65hEu8pgxj39%2Bk_d3s6CYEQz45ZcpXjK-JO0g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:32am UTC](https://discuss.elastic.co/t/searching-ip-address-range-using-cidr-mask/22114/5 "2017-07-06T00:32:50Z")

</div>


