# Usage Stored Scripts in the Timelion query

**URL:** https://discuss.elastic.co/t/usage-stored-scripts-in-the-timelion-query/158934
**Category:** Kibana
**Tags:** timelion
**Created:** [November 30, 2018, 3:58pm UTC](https://discuss.elastic.co/t/usage-stored-scripts-in-the-timelion-query/158934 "2018-11-30T15:58:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Senter](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Senter](https://discuss.elastic.co/u/Senter)
#### Post date: [November 30, 2018, 3:58pm UTC](https://discuss.elastic.co/t/usage-stored-scripts-in-the-timelion-query/158934/1 "2018-11-30T15:58:35Z")

</div>

Hi all,

I have a lot of docs and I would like to create visualization with Timelion. But basic tools doesn't give ability to calculate all conditions. Therefore I wrote a _ **painless** _ script which calculate necessary Dates List. In the past version (5.2) I used next query

```
.es( index='index', 
     kibana='true', 
     timeFilter='( _exists_:failed_when_timestamps OR _exists_:blocked_when_timestamps )', 
     script='BackloggedDates', 
     scriptType='file', 
     scriptParams='{"fields":[...]}')

```

Now this construction doesn't work.

I would like to take info about _script_ and _scriptType_ attributes. Internet search returned no results.

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [December 3, 2018, 7:55pm UTC](https://discuss.elastic.co/t/usage-stored-scripts-in-the-timelion-query/158934/2 "2018-12-03T19:55:18Z")

</div>

Can you please provide some sample documents from Elasticsearch that you use with this query?

---

<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: [December 31, 2018, 7:55pm UTC](https://discuss.elastic.co/t/usage-stored-scripts-in-the-timelion-query/158934/3 "2018-12-31T19:55:37Z")

</div>

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