# Filter the metrics column

**URL:** <https://discuss.elastic.co/t/filter-the-metrics-column/307230>\
**Category:** Kibana\
**Created:** [June 15, 2022, 7:16am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230 "2022-06-15T07:16:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [June 15, 2022, 7:16am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/1 "2022-06-15T07:16:50Z")

</div>

Hello,  
I created with TSVB a table with two columns. The table displays the date of the last document of each server (Top hit..).

> server 2 | 2022-06-15  
> server 2 | 2022-06-15  
> server 3 | 2022-06-12

I would like to filter the date column (or the whole table) to display only the servers whose date is older than one day, like this :

> server 3 | 2022-06-12

I.e. to see the servers that have not sent anything for more than one day.

This is actually a filter on my metric (top hit) that I would like to do, but the filters are applied before the metric and not after.

How can i do this ? Is TSVB the best way ?

Thank !

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [June 15, 2022, 8:10am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/2 "2022-06-15T08:10:02Z")

</div>

Hi @GinkoLucas ,

what version of the stack you have?

---

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [June 15, 2022, 8:11am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/3 "2022-06-15T08:11:21Z")

</div>

Hi @Marco_Liberati,

It's v8.1.2

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [June 15, 2022, 8:47am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/4 "2022-06-15T08:47:05Z")

</div>

I think what you could do in TSVB is to declare a filter on the date field with the `is now between`:

 ![Screenshot 2022-06-15 at 10.45.16](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd0db7d38ec0ab39abc1e4f22f894918eac94297.png)

In the example above I'm showing only results older than 1 hour from now.

Or as an alternative you can use Lens and declare a `my-date-field < now-1d` as in this example:

 ![Screenshot 2022-06-15 at 10.45.37](https://us1.discourse-cdn.com/elastic/original/3X/3/4/34ca7312bad318215ea4eb5c39754e663cd8bdd9.png)

---

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [June 15, 2022, 9:02am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/5 "2022-06-15T09:02:30Z")

</div>

Thank you for your answer.  
It doesn't work, maybe I misspoke.  
Applying a filter like this will filter the data set and not the metric directly. This means that my table will show me the last data received older than one day for all server.  
For example, let's imagine this :

this is my dataset :

> server 1 | 2022-06-15  
> server 1 | 2022-06-14  
> server 1 | 2022-06-13  
> server 2 | 2022-06-15  
> server 2 | 2022-06-14  
> server 2 | 2022-06-13  
> server 3 | 2022-06-13

I would like this :

> server 3 |2022-06-13

your way of doing things give me this :

> server 1 | 2022-06-13  
> server 2 | 2022-06-14  
> server 3 | 2022-06-13

To be clearer, basically I would like to display the servers that have not sent me a log for more than a day. And i would like to see the date of the last document.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [June 15, 2022, 10:27am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/6 "2022-06-15T10:27:12Z")

</div>

I see what you mean.  
I think there's currently no way to hide it, but there's already a ticket for this feature request you can track the progress here: [[Lens] Table Allow for Filtering of Rows on the string Column Value(s) · Issue #122170 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/122170)

---

<div class="post-metadata">

**Author:** ![GinkoLucas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ginkolucas/32/107055_2.png) [@GinkoLucas](https://discuss.elastic.co/u/GinkoLucas)\
**Post date:** [June 15, 2022, 11:04am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/7 "2022-06-15T11:04:46Z")

</div>

Okay Marco,

Thanks for your help !  
🙂

---

<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 13, 2022, 11:05am UTC](https://discuss.elastic.co/t/filter-the-metrics-column/307230/8 "2022-07-13T11:05:37Z")

</div>

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