# Elastic search scripting help

**URL:** <https://discuss.elastic.co/t/elastic-search-scripting-help/21979>\
**Category:** Elasticsearch\
**Created:** [February 4, 2015, 7:24pm UTC](https://discuss.elastic.co/t/elastic-search-scripting-help/21979 "2015-02-04T19:24:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samatha\_kankipati](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@samatha\_kankipati](https://discuss.elastic.co/u/samatha_kankipati)\
**Post date:** [February 4, 2015, 7:24pm UTC](https://discuss.elastic.co/t/elastic-search-scripting-help/21979/1 "2015-02-04T19:24:07Z")

</div>

Hi ,  
I would like find the duration between current time and updatedAt time of  
document stored in ES ..  
I am trying to use scripting..  
script should get

1. current time
2. \_source.updatedAt
3. then find the difference in minutes
4. and then do some more calculations..

I tried with multiple ways, But I am getting errors like this  
java.lang.SecurityException: Expression [ConstructorCallExpression] is not  
allowed  
or  
java.lang.SecurityException: Importing  
[org.joda.time.format.ISODateTimeFormat] is not allowed  
or  
java.lang.SecurityException: Method calls not allowed

Please help me to find the solution for this...

Thanks  
Samatha

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c3adcab2-ffd5-42d1-b601-248e0e5e274e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3adcab2-ffd5-42d1-b601-248e0e5e274e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:34am UTC](https://discuss.elastic.co/t/elastic-search-scripting-help/21979/2 "2017-07-06T00:34:57Z")

</div>

Closed on July 6, 2017, 12:34am UTC


