# Making a delay scripted field from a field containing several dates

**URL:** <https://discuss.elastic.co/t/making-a-delay-scripted-field-from-a-field-containing-several-dates/254063>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [November 2, 2020, 5:45pm UTC](https://discuss.elastic.co/t/making-a-delay-scripted-field-from-a-field-containing-several-dates/254063 "2020-11-02T17:45:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Di](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_di/32/78264_2.png) [@Mike\_Di](https://discuss.elastic.co/u/Mike_Di)\
**Post date:** [November 2, 2020, 5:45pm UTC](https://discuss.elastic.co/t/making-a-delay-scripted-field-from-a-field-containing-several-dates/254063/1 "2020-11-02T17:45:47Z")

</div>

Hello, i would like to make a scripted field of a delay process time from a field which contains several dates separated by a comma like this

`dates_multi : 2020-07-17 04:02:00,2020-07-24 04:02:00,2020-07-31 04:02:00,2020-08-07 04:02:00,2020-08-14 04:02:00,2020-08-21 04:02:00,2020-08-28 04:02:00,2020-09-04 04:02:00,2020-11-02 01:36:37`

So first of all i would try to split the field by comma then taking the last element of the list minus the first element of the splited list then returning my scripted field in a day format like this, ex: `delay_process: 3.5` however I am not able to figure out how to do this processing using painless, I would be grateful for any kind of help.

---

<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:** [November 30, 2020, 5:46pm UTC](https://discuss.elastic.co/t/making-a-delay-scripted-field-from-a-field-containing-several-dates/254063/2 "2020-11-30T17:46:16Z")

</div>

Closed on November 30, 2020, 5:46pm UTC

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