# Kibana scripted fields

**URL:** <https://discuss.elastic.co/t/kibana-scripted-fields/262675>\
**Category:** Kibana\
**Created:** [January 29, 2021, 5:40pm UTC](https://discuss.elastic.co/t/kibana-scripted-fields/262675 "2021-01-29T17:40:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)\
**Post date:** [January 29, 2021, 5:40pm UTC](https://discuss.elastic.co/t/kibana-scripted-fields/262675/1 "2021-01-29T17:40:14Z")

</div>

i have several boolean fields like **weekDays.friday.is24HourService, weekDays.saturday.is24HourService** in my index.  
i am getting the day of week using **[doc['@timestamp'].value.dayOfWeek]** which returns a numeric value, for ex it returns the value 5 for friday.  
i want to replace this numeric value with the day present in in my data. how to do this using scripted fields. please help 🙂

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [January 29, 2021, 6:20pm UTC](https://discuss.elastic.co/t/kibana-scripted-fields/262675/2 "2021-01-29T18:20:53Z")

</div>

I'd try something like this. Might want to add a value for unknown key but I doubt that will happen if you are using `@timestamp`.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2be8dd7e7eda2b44a83394a41deac4280ccd3f2.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 26, 2021, 6:21pm UTC](https://discuss.elastic.co/t/kibana-scripted-fields/262675/3 "2021-02-26T18:21:24Z")

</div>

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