# Filtering problem

**URL:** <https://community.grafana.com/t/filtering-problem/144472>\
**Category:** Elasticsearch\
**Created:** [February 20, 2025, 10:29am UTC](https://community.grafana.com/t/filtering-problem/144472 "2025-02-20T10:29:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aizikadi50](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@aizikadi50](https://community.grafana.com/u/aizikadi50)\
**Post date:** [February 20, 2025, 10:29am UTC](https://community.grafana.com/t/filtering-problem/144472/1 "2025-02-20T10:29:06Z")

</div>

i have grafana v10.3.3 and I’ve created a panel with elasticsearch data source of a timeseries graph. with the following query: aggregation- count, group by-terms, by- ServerName.keyword, Top 10, Min Doc Count Order by: Doc count, and then group by- Data histogram @timestamp, inerval 10s.the data is from logs that have ip addresses data as well. so i wanted to filter by device ip, so i created a text box variable and i want that if i type an ip address in the text box it will filter the data by the ip address and if not it will not filter anything. i tried a lot of lucene queries and they did not work. what do you suggest me to do?

---

<div class="post-metadata">

**Author:** ![dawiddebowski](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/dawiddebowski/32/49435_2.png) [@dawiddebowski](https://community.grafana.com/u/dawiddebowski)\
**Post date:** [February 20, 2025, 6:07pm UTC](https://community.grafana.com/t/filtering-problem/144472/2 "2025-02-20T18:07:14Z")

</div>

Hi, I did something similar like two days ago 😄

You can use following Lucene query:

> \< your field \>: ${\< variable name \>:raw}

e.g.

> device.ip: ${var:raw}

and in your variable settings set Default value to `*`

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/f/a/fa64712dd9a97f4e4068779f822ccef30584fd65.png)

should work

---

<div class="post-metadata">

**Author:** ![aizikadi50](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@aizikadi50](https://community.grafana.com/u/aizikadi50)\
**Post date:** [February 25, 2025, 8:32am UTC](https://community.grafana.com/t/filtering-problem/144472/3 "2025-02-25T08:32:12Z")

</div>

hi thanks but there’s a problem that when I type anything into the text box it becomes the default value instead of the _. so that after I type something in the text box and delete it, it doesn’t give me all the options because the default value is no longer "_"

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [February 25, 2025, 11:42am UTC](https://community.grafana.com/t/filtering-problem/144472/4 "2025-02-25T11:42:35Z")

</div>

Did you set default value of variable to be \*

---

<div class="post-metadata">

**Author:** ![aizikadi50](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@aizikadi50](https://community.grafana.com/u/aizikadi50)\
**Post date:** [February 25, 2025, 11:55am UTC](https://community.grafana.com/t/filtering-problem/144472/5 "2025-02-25T11:55:22Z")

</div>

yes and it still changed after I typed something into the text box
