# Add CIDR IP range in Timelion

**URL:** <https://discuss.elastic.co/t/add-cidr-ip-range-in-timelion/253247>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [October 25, 2020, 7:40pm UTC](https://discuss.elastic.co/t/add-cidr-ip-range-in-timelion/253247 "2020-10-25T19:40:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![savethebyte](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/savethebyte/32/62742_2.png) [@savethebyte](https://discuss.elastic.co/u/savethebyte)\
**Post date:** [October 25, 2020, 7:40pm UTC](https://discuss.elastic.co/t/add-cidr-ip-range-in-timelion/253247/1 "2020-10-25T19:40:09Z")

</div>

Is there a way to do a search for an IP range in a Timelion? I need to search a larger amount of time but only with a specific set of IPs.

I need to do something like this:

```auto
.es(index="filebeat-*", metric="sum:network.bytes", split="source.ip:10", kibana=true, q=source.ip:10.0.0.0/24).scale_interval(1s).fit(mode=scale).if(operator="lt", if=0, then=0).trim(start=2,end=1).label(regex="^.* source.ip:(.+) > .*$", label="$1").lines(width=1, stack=true, fill=1).yaxis(label="bytes / sec", min=0)

```

I need to do a query on a range of IPs (10.0.0.0/24 in this example). Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [October 29, 2020, 8:26pm UTC](https://discuss.elastic.co/t/add-cidr-ip-range-in-timelion/253247/2 "2020-10-29T20:26:18Z")

</div>

The query string filter in Elasticsearch supports the range filter for IP data, and `q` uses query string query:

```auto
.es(index=tests-*,timefield=@date,metric=sum:whatever,q="ip:[0.0.0.0 TO 10.255.255.255]")

```

Another thing you could do is add the Timelion panel to a dashboard, and use the global filter to do a range query on the IP field, using KQL:

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

---

<div class="post-metadata">

**Author:** ![savethebyte](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/savethebyte/32/62742_2.png) [@savethebyte](https://discuss.elastic.co/u/savethebyte)\
**Post date:** [November 2, 2020, 8:53pm UTC](https://discuss.elastic.co/t/add-cidr-ip-range-in-timelion/253247/3 "2020-11-02T20:53:27Z")

</div>

The dashboard route is what I ended up doing, but it was a temporary "fix" until I figured out the range you provided. Thank you!

---

<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:** [November 30, 2020, 8:53pm UTC](https://discuss.elastic.co/t/add-cidr-ip-range-in-timelion/253247/4 "2020-11-30T20:53:46Z")

</div>

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