# Is it possible to use a scripted field for the timefield parameter in timelion queries

**URL:** https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-for-the-timefield-parameter-in-timelion-queries/237760
**Category:** Kibana
**Tags:** timelion
**Created:** [June 19, 2020, 8:07am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-for-the-timefield-parameter-in-timelion-queries/237760 "2020-06-19T08:07:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Naveen\_Kumar3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naveen_kumar3/32/58280_2.png) [@Naveen\_Kumar3](https://discuss.elastic.co/u/Naveen_Kumar3)
#### Post date: [June 19, 2020, 8:07am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-for-the-timefield-parameter-in-timelion-queries/237760/1 "2020-06-19T08:07:39Z")

</div>

Hi,  
The Kibana version I am using is 7.4.2  
Initially, while creating my ElasticSearch domain, I had made a mistake of not mapping my index with a field of the 'date' type. I am using a Kinesis firehose to send data to my ElasticSearch domain and I was sending the time in epoch milliseconds. ElasticSearch indexed this as a field of the 'number' type, as a result of which I did not have any 'date' type field in my index and wasn't able to create any timelion visualizations.  
To circumvent this, I stumbled across the 'Scripted field' which allowed me to create a field of the 'date' type from my time field.  
However, when I was using this in my timelion query, I am able to see only 0's, despite having a lot of data. Even this query is returning me all 0's  
`.es(q=*, timefield=timestamp)` [timestamp is the name of scripted field I created]

I was wondering if using scripted field for the timefield parameter is supported in my Kibana version or am I missing something?

Thanks in advance!

---

<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 17, 2020, 8:07am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-for-the-timefield-parameter-in-timelion-queries/237760/2 "2020-07-17T08:07:45Z")

</div>

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