# Filtering local holidays(date) in Kibana dashboard

**URL:** <https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875>\
**Category:** Kibana\
**Tags:** painless\
**Created:** [May 13, 2021, 3:01am UTC](https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875 "2021-05-13T03:01:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohanss08](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohanss08/32/82297_2.png) [@mohanss08](https://discuss.elastic.co/u/mohanss08)\
**Post date:** [May 13, 2021, 3:01am UTC](https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875/1 "2021-05-13T03:01:18Z")

</div>

I’m using ELK – 7.12.1 and the following days are our local holidays.

```
01-Jan-2021
14-Jan-2021
26-Jan-2021
11-Mar-2021
02-Apr-2021
13-Apr-2021

```

In Kibana dashboard is it possible to exclude these holidays(specific dates) by applying some filters? If yes please let me know the method, it would be helpful. Thanks.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 13, 2021, 8:56am UTC](https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875/2 "2021-05-13T08:56:58Z")

</div>

you can start composing a huge filter in the filter bar, something like this:  
(@timestamp \< "2021-01-01T00:00:00" OR @timestamp \> "2021-01-01T23:59:59") AND (@timestamp \< "2021-01-14T00:00:00" OR @timestamp \> "2021-01-14T23:59:59") .... and so on.

Or, the prettier version: create a scripted field (something called holiday maybe) that checks if the timestamp is in any of those days and returns true if it is. And then just filter on the dashboard/visualization for holiday = False and that should be it.

---

<div class="post-metadata">

**Author:** ![mohanss08](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohanss08/32/82297_2.png) [@mohanss08](https://discuss.elastic.co/u/mohanss08)\
**Post date:** [May 13, 2021, 9:26am UTC](https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875/3 "2021-05-13T09:26:38Z")

</div>

Ok marius thanks. Scripted field would be best, So can you please help me with that?

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 14, 2021, 12:33pm UTC](https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875/5 "2021-05-14T12:33:00Z")

</div>

There isn't one already created, but you can follow on from this:

```auto
def month = doc['@timestamp'].value.getMonthValue();
def day = doc['timestamp'].value.getDayOfMonth();
if (month == 1){
    if ((day == 1) || (day == 14) || (day == 16)) {
        return true
    }
    else {
        return false
    }
}

```

you can extend it with further days following this example.

---

<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 21, 2021, 3:10pm UTC](https://discuss.elastic.co/t/filtering-local-holidays-date-in-kibana-dashboard/272875/10 "2021-06-21T15:10:53Z")

</div>

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