# Search IP

**URL:** https://discuss.elastic.co/t/search-ip/132344
**Category:** Elasticsearch
**Created:** [May 17, 2018, 1:35pm UTC](https://discuss.elastic.co/t/search-ip/132344 "2018-05-17T13:35:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![asalma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asalma/32/32199_2.png) [@asalma](https://discuss.elastic.co/u/asalma)
#### Post date: [May 17, 2018, 1:35pm UTC](https://discuss.elastic.co/t/search-ip/132344/1 "2018-05-17T13:35:59Z")

</div>

I did this PUT in order to be able to search an interval of IP @ but it doesn't work !!

![image](https://us1.discourse-cdn.com/elastic/original/3X/4/4/445ae9305c891fac119cc6e7429823f7e54a7410.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/e/bedf24e7a12840e22e9a45235baba70d338d91e9.png)

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [May 17, 2018, 2:08pm UTC](https://discuss.elastic.co/t/search-ip/132344/2 "2018-05-17T14:08:52Z")

</div>

You'll need to specify the field that you wish to query. Without a specific field, the query will default to all fields which will give you strange results (e.g. the IP will be tokenized into a string for string fields, and may match random things).

See the query syntax here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#\_ranges](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_ranges)

E.g.

```auto
src_ip:[10.192.1.0 TO 10.192.1.9]

```

---

<div class="post-metadata">

### Author: ![asalma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asalma/32/32199_2.png) [@asalma](https://discuss.elastic.co/u/asalma)
#### Post date: [May 17, 2018, 2:13pm UTC](https://discuss.elastic.co/t/search-ip/132344/3 "2018-05-17T14:13:08Z")

</div>

Thank you, it is working 😊

---

<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: [June 14, 2018, 2:13pm UTC](https://discuss.elastic.co/t/search-ip/132344/4 "2018-06-14T14:13:10Z")

</div>

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