# Kibana: scripts in json input not working

**URL:** <https://discuss.elastic.co/t/kibana-scripts-in-json-input-not-working/23160>\
**Category:** Elasticsearch\
**Created:** [April 9, 2015, 12:14am UTC](https://discuss.elastic.co/t/kibana-scripts-in-json-input-not-working/23160 "2015-04-09T00:14:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akudva](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Akudva](https://discuss.elastic.co/u/Akudva)\
**Post date:** [April 9, 2015, 12:14am UTC](https://discuss.elastic.co/t/kibana-scripts-in-json-input-not-working/23160/1 "2015-04-09T00:14:44Z")

</div>

Hello,

I am getting error while adding scripts in json input while doing  
aggregation(date histogram).  
Am I missing any configuration options which I need to do before using this?

Any help would be appreciated!

Below is the script:  
{  
"script":"log(\_value)"  
}

Request to Elasticsearch failed: {"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[qsuoq24rQCmt-BkEuwe1tg][logstash-2015.04.08][0]: SearchParseException[[logstash-2015.04.08][0]: query[ConstantScore(BooleanFilter(+cache(@timestamp:[1428465600000 TO 1428551999999])))],from[-1],size[0]: Parse Failure [Failed to parse source [{"size":0,"query":{"filtered":{"query":{"query\_string":{"analyze\_wildcard":true,"query":"_"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1428465600000,"lte":1428551999999}}}],"must\_not":[]}}}},"aggs":{"2":{"date\_histogram":{"field":"@timestamp","interval":"30m","pre\_zone":"-04:00","pre\_zone\_adjust\_large\_interval":true,"min\_doc\_count":1,"extended\_bounds":{"min":1428465600000,"max":1428551999999},"script":"log(\_value)"}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[qsuoq24rQCmt-BkEuwe1tg][logstash-2015.04.08][1]: SearchParseException[[logstash-2015.04.08][1]: query[ConstantScore(BooleanFilter(+cache(@timestamp:[1428465600000 TO 1428551999999])))],from[-1],size[0]: Parse Failure [Failed to parse source [{"size":0,"query":{"filtered":{"query":{"query\_string":{"analyze\_wildcard":true,"query":"_"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1428465600000,"lte":1428551999999}}}],"must\_not":[]}}}},"aggs":{"2":{"date\_histogram":{"field":"@timestamp","interval":"30m","pre\_zone":"-04:00","pre\_zone\_adjust\_large\_interval":true,"min\_doc\_count":1,"extended\_bounds":{"min":1428465600000,"max":1428551999999},"script":"log(\_value)"}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[qsuoq24rQCmt-BkEuwe1tg][logstash-2015.04.08][2]: SearchParseException[[logstash-2015.04.08][2]: query[ConstantScore(BooleanFilter(+cache(@timestamp:[1428465600000 TO 1428551999999])))],from[-1],size[0]: Parse Failure [Failed to parse source [{"size":0,"query":{"filtered":{"query":{"query\_string":{"analyze\_wildcard":true,"query":"_"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1428465600000,"lte":1428551999999}}}],"must\_not":[]}}}},"aggs":{"2":{"date\_histogram":{"field":"@timestamp","interval":"30m","pre\_zone":"-04:00","pre\_zone\_adjust\_large\_interval":true,"min\_doc\_count":1,"extended\_bounds":{"min":1428465600000,"max":1428551999999},"script":"log(\_value)"}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[qsuoq24rQCmt-BkEuwe1tg][logstash-2015.04.08][3]: SearchParseException[[logstash-2015.04.08][3]: query[ConstantScore(BooleanFilter(+cache(@timestamp:[1428465600000 TO 1428551999999])))],from[-1],size[0]: Parse Failure [Failed to parse source [{"size":0,"query":{"filtered":{"query":{"query\_string":{"analyze\_wildcard":true,"query":"_"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1428465600000,"lte":1428551999999}}}],"must\_not":[]}}}},"aggs":{"2":{"date\_histogram":{"field":"@timestamp","interval":"30m","pre\_zone":"-04:00","pre\_zone\_adjust\_large\_interval":true,"min\_doc\_count":1,"extended\_bounds":{"min":1428465600000,"max":1428551999999},"script":"log(\_value)"}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }{[qsuoq24rQCmt-BkEuwe1tg][logstash-2015.04.08][4]: SearchParseException[[logstash-2015.04.08][4]: query[ConstantScore(BooleanFilter(+cache(@timestamp:[1428465600000 TO 1428551999999])))],from[-1],size[0]: Parse Failure [Failed to parse source [{"size":0,"query":{"filtered":{"query":{"query\_string":{"analyze\_wildcard":true,"query":"\*"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":1428465600000,"lte":1428551999999}}}],"must\_not":[]}}}},"aggs":{"2":{"date\_histogram":{"field":"@timestamp","interval":"30m","pre\_zone":"-04:00","pre\_zone\_adjust\_large\_interval":true,"min\_doc\_count":1,"extended\_bounds":{"min":1428465600000,"max":1428551999999},"script":"log(\_value)"}}}}]]]; nested: ScriptException[dynamic scripting for [groovy] disabled]; }]"}KbnError@[http://localhost:5601/index.js?\_b=5930:39210:21](http://localhost:5601/index.js?_b=5930:39210:21)  
RequestFailure@[http://localhost:5601/index.js?\_b=5930:39247:1](http://localhost:5601/index.js?_b=5930:39247:1)  
callResponseHandlers/\<@[http://localhost:5601/index.js?\_b=5930:42978:38](http://localhost:5601/index.js?_b=5930:42978:38)  
Promise.try@[http://localhost:5601/index.js?\_b=5930:46205:23](http://localhost:5601/index.js?_b=5930:46205:23)  
Promise.map/\<@[http://localhost:5601/index.js?\_b=5930:46183:16](http://localhost:5601/index.js?_b=5930:46183:16)  
Promise.map@[http://localhost:5601/index.js?\_b=5930:46182:26](http://localhost:5601/index.js?_b=5930:46182:26)  
callResponseHandlers@[http://localhost:5601/index.js?\_b=5930:42950:1](http://localhost:5601/index.js?_b=5930:42950:1)  
fetchWithStrategy/\<@[http://localhost:5601/index.js?\_b=5930:43068:16](http://localhost:5601/index.js?_b=5930:43068:16)  
qFactory/defer/deferred.promise.then/wrappedCallback@[http://localhost:5601/index.js?\_b=5930:20873:31](http://localhost:5601/index.js?_b=5930:20873:31)  
qFactory/defer/deferred.promise.then/wrappedCallback@[http://localhost:5601/index.js?\_b=5930:20873:31](http://localhost:5601/index.js?_b=5930:20873:31)  
qFactory/ref/\<.then/\<@[http://localhost:5601/index.js?\_b=5930:20959:26](http://localhost:5601/index.js?_b=5930:20959:26)  
$RootScopeProvider/this.$get\</Scope.prototype.$eval@[http://localhost:5601/index.js?\_b=5930:22002:16](http://localhost:5601/index.js?_b=5930:22002:16)  
$RootScopeProvider/this.$get\</Scope.prototype.$digest@[http://localhost:5601/index.js?\_b=5930:21814:15](http://localhost:5601/index.js?_b=5930:21814:15)  
$RootScopeProvider/this.$get\</Scope.prototype.$apply@[http://localhost:5601/index.js?\_b=5930:22106:13](http://localhost:5601/index.js?_b=5930:22106:13)  
done@[http://localhost:5601/index.js?\_b=5930:17641:34](http://localhost:5601/index.js?_b=5930:17641:34)  
completeRequest@[http://localhost:5601/index.js?\_b=5930:17855:7](http://localhost:5601/index.js?_b=5930:17855:7)  
createHttpBackend/\</xhr.onreadystatechange@[http://localhost:5601/index.js?\_b=5930:17794:1](http://localhost:5601/index.js?_b=5930:17794:1)

--  
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/ea35e32b-1c3e-49c1-af00-be1a3abec945%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ea35e32b-1c3e-49c1-af00-be1a3abec945%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:20am UTC](https://discuss.elastic.co/t/kibana-scripts-in-json-input-not-working/23160/2 "2017-07-06T00:20:42Z")

</div>


