# Variable \[clock\] is not defined

**URL:** <https://discuss.elastic.co/t/variable-clock-is-not-defined/189102>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [July 5, 2019, 12:49pm UTC](https://discuss.elastic.co/t/variable-clock-is-not-defined/189102 "2019-07-05T12:49:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kohinor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kohinor/32/49511_2.png) [@Kohinor](https://discuss.elastic.co/u/Kohinor)\
**Post date:** [July 5, 2019, 12:49pm UTC](https://discuss.elastic.co/t/variable-clock-is-not-defined/189102/1 "2019-07-05T12:49:48Z")

</div>

Hi, there.

Zabbix use script to aggregation  
"aggregations": {  
"group\_by\_script": {  
"terms": {  
"script": {  
"source": "Math.floor((params.width\*((doc['clock.data'].getMillis()/1000+params.delta)%params.size))/params.size)",  
"lang": "painless"  
, "params": {  
"size": 300,  
"width": 1337,  
"delta": 234  
}  
After update to elk 7.2 it retuns error

> {  
> "shard": 0,  
> "index": "dbl-2019-07-04",  
> "node": "Dlz86WeuSAGgN8K1rLjfSA",  
> "reason": {  
> "type": "script\_exception",  
> "reason": "compile error",  
> "script\_stack": [  
> "... loor((params.width\*((doc[clock].date.getMillis()/1 ...",  
> "\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ ^---- HERE"  
> ],  
> "script": "Math.floor((params.width\*((doc[clock].date.getMillis()/1000+params.delta)%params.size))/params.size)",  
> "lang": "painless",  
> "caused\_by": {  
> "type": "illegal\_argument\_exception",  
> "reason": "Variable [clock] is not defined."  
> }  
> }  
> }

Can anyone help me to change script if it's possible.

---

<div class="post-metadata">

**Author:** ![Kohinor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kohinor/32/49511_2.png) [@Kohinor](https://discuss.elastic.co/u/Kohinor)\
**Post date:** [July 8, 2019, 8:07am UTC](https://discuss.elastic.co/t/variable-clock-is-not-defined/189102/2 "2019-07-08T08:07:10Z")

</div>

The problem is not actual

---

<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:** [August 5, 2019, 8:07am UTC](https://discuss.elastic.co/t/variable-clock-is-not-defined/189102/3 "2019-08-05T08:07:11Z")

</div>

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