# Watcher Condition "script" : { "script" : ""}}. Not working

**URL:** <https://discuss.elastic.co/t/watcher-condition-script-script-not-working/39710>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [January 20, 2016, 10:36pm UTC](https://discuss.elastic.co/t/watcher-condition-script-script-not-working/39710 "2016-01-20T22:36:40Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![pgcr](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pgcr](https://discuss.elastic.co/u/pgcr)\
**Post date:** [February 2, 2016, 7:44pm UTC](https://discuss.elastic.co/t/watcher-condition-script-script-not-working/39710/5 "2016-02-02T19:44:56Z")

</div>

Im also receiving the same error when attempting to setup a new watch.  
{  
"error": {  
"root\_cause": [  
{  
"type": "script\_exception",  
"reason": "failed to compile script [ScriptException[scripts of type [inline], operation [elasticsearch-watcher\_watch] and lang [groovy] are disabled]] with lang [if (ctx.payload.aggregations.minutes.buckets.size() == 0) return false; def latest = ctx.payload.aggregations.minutes.buckets[-1]; def node = latest.nodes.buckets[0]; return node && node.memory && node.memory.value \>= 75;] of type [groovy]"  
}  
],  
"type": "script\_exception",  
"reason": "failed to compile script [ScriptException[scripts of type [inline], operation [elasticsearch-watcher\_watch] and lang [groovy] are disabled]] with lang [if (ctx.payload.aggregations.minutes.buckets.size() == 0) return false; def latest = ctx.payload.aggregations.minutes.buckets[-1]; def node = latest.nodes.buckets[0]; return node && node.memory && node.memory.value \>= 75;] of type [groovy]"  
},  
"status": 500  
}

Reference: [https://www.elastic.co/guide/en/watcher/current/watching-marvel-data.html#watching-memory-usage](https://www.elastic.co/guide/en/watcher/current/watching-marvel-data.html#watching-memory-usage)

Any help would be grateful.

---

_[View the full topic](https://discuss.elastic.co/t/watcher-condition-script-script-not-working/39710)._
