# "dynamic method \[java.lang.Long, toInstant/0\] not found"

**URL:** <https://discuss.elastic.co/t/dynamic-method-java-lang-long-toinstant-0-not-found/328127>\
**Category:** Kibana\
**Tags:** elastic-stack-monitoring\
**Created:** [March 21, 2023, 5:36am UTC](https://discuss.elastic.co/t/dynamic-method-java-lang-long-toinstant-0-not-found/328127 "2023-03-21T05:36:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saupuran](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@saupuran](https://discuss.elastic.co/u/saupuran)\
**Post date:** [March 21, 2023, 5:36am UTC](https://discuss.elastic.co/t/dynamic-method-java-lang-long-toinstant-0-not-found/328127/1 "2023-03-21T05:36:55Z")

</div>

Currently we are using 'LogDate' as scripted field with script doc['transactiondate'].value to convert unix time format of 'transactiondate' into human readable date format. When we apply filter with 'LogDate', conditions 'gte' & 'lt' get applied to input dates in query script that is being generated. Query script uses toInstant() method which is not valid for long value so the shards start to fail & we get error as below  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "dynamic method [java.lang.Long, toInstant/0] not found"

---

<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:** [April 18, 2023, 5:37am UTC](https://discuss.elastic.co/t/dynamic-method-java-lang-long-toinstant-0-not-found/328127/2 "2023-04-18T05:37:48Z")

</div>

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