# Trying to use custom DSL in Kibana

**URL:** https://discuss.elastic.co/t/trying-to-use-custom-dsl-in-kibana/216724
**Category:** Kibana
**Created:** [January 27, 2020, 9:11pm UTC](https://discuss.elastic.co/t/trying-to-use-custom-dsl-in-kibana/216724 "2020-01-27T21:11:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dleota](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dleota](https://discuss.elastic.co/u/dleota)
#### Post date: [January 27, 2020, 9:11pm UTC](https://discuss.elastic.co/t/trying-to-use-custom-dsl-in-kibana/216724/1 "2020-01-27T21:11:22Z")

</div>

Hello I am trying to write a custom dsl query to add a filter that only includes week ends and or one that only includes weekends. I'm going to make two separate filters. I am new to Elastic and JSON. I also don't have permissions to access index so I cannot created a scripted field. My date field is "entryDate".  
{  
"query":{  
"filter":{  
doc['entryDate'].date.dayOfWeek == 6  
}  
}  
}

I know this is off but I just wanted to show what I have so far. Thanks so much.

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [January 27, 2020, 10:47pm UTC](https://discuss.elastic.co/t/trying-to-use-custom-dsl-in-kibana/216724/2 "2020-01-27T22:47:39Z")

</div>

To do this, you'll want to switch the language from KQL to Lucene (I know, not the most intuitive), and then take everything inside "query" and put it in the query bar.

---

<div class="post-metadata">

### Author: ![dleota](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dleota](https://discuss.elastic.co/u/dleota)
#### Post date: [January 28, 2020, 2:00pm UTC](https://discuss.elastic.co/t/trying-to-use-custom-dsl-in-kibana/216724/3 "2020-01-28T14:00:25Z")

</div>

Okay I switched to Lucene and in the query bar I entered:  
"entryDate.date.dayOfWeek == 6" I want to eventually only return dates that fall on the weekend but just tried for Saturday now. This query reduced the number of hits and I didn't get an error, however its still showing records from 7/31/19 which did not fall on a Saturday. Any idea what I'm missing thank you.

 ![dayofweekquery](https://us1.discourse-cdn.com/elastic/original/3X/9/2/92176b7a597f8deb1c9ba7c10556146c04b90597.png)

---

<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: [February 25, 2020, 2:00pm UTC](https://discuss.elastic.co/t/trying-to-use-custom-dsl-in-kibana/216724/4 "2020-02-25T14:00:32Z")

</div>

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