Hello,
I am trying to add a manually created scripted field using the dropdown box
withing Aggregation:
Any pointers on how to resolve this error would be very helpful.
Scriped field:
Name: @hourOfDay
Script: Integer.parseInt(new Date(doc["@timestamp"}.value).format("H"))
Below is the error:
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":{"histogram":{"script":"Integer.parseInt(new Date(doc[\"@timestamp\"}.value).format(\"H\"))","lang":"expression","interval":1}}}}]]]; nested: ExpressionScriptCompilationException[Failed to parse expression: Integer.parseInt(new Date(doc["@timestamp"}.value).format("H"))]; nested: ParseException[ invalid sequence of tokens near 'Date' at position (21).]; nested: NoViableAltException; }{[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":{"histogram":{"script":"Integer.parseInt(new Date(doc[\"@timestamp\"}.value).format(\"H\"))","lang":"expression","interval":1}}}}]]]; nested: ExpressionScriptCompilationException[Failed to parse expression: Integer.parseInt(new Date(doc["@timestamp"}.value).format("H"))]; nested: ParseException[ invalid sequence of tokens near 'Date' at position (21).]; nested: NoViableAltException; }{[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":{"histogram":{"script":"Integer.parseInt(new Date(doc[\"@timestamp\"}.value).format(\"H\"))","lang":"expression","interval":1}}}}]]]; nested: ExpressionScriptCompilationException[Failed to parse expression: Integer.parseInt(new Date(doc["@timestamp"}.value).format("H"))]; nested: ParseException[ invalid sequence of tokens near 'Date' at position (21).]; nested: NoViableAltException; }{[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":{"histogram":{"script":"Integer.parseInt(new Date(doc[\"@timestamp\"}.value).format(\"H\"))","lang":"expression","interval":1}}}}]]]; nested: ExpressionScriptCompilationException[Failed to parse expression: Integer.parseInt(new Date(doc["@timestamp"}.value).format("H"))]; nested: ParseException[ invalid sequence of tokens near 'Date' at position (21).]; nested: NoViableAltException; }{[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":{"histogram":{"script":"Integer.parseInt(new Date(doc[\"@timestamp\"}.value).format(\"H\"))","lang":"expression","interval":1}}}}]]]; nested: ExpressionScriptCompilationException[Failed to parse expression: Integer.parseInt(new Date(doc["@timestamp"}.value).format("H"))]; nested: ParseException[ invalid sequence of tokens near 'Date' at position (21).]; nested: NoViableAltException; }]"}KbnError@http://localhost:5601/index.js?_b=5930:39210:21
RequestFailure@http://localhost:5601/index.js?_b=5930:39247:1
callResponseHandlers/<@http://localhost:5601/index.js?_b=5930:42978:38
Promise.try@http://localhost:5601/index.js?_b=5930:46205:23
Promise.map/<@http://localhost:5601/index.js?_b=5930:46183:16
Promise.map@http://localhost:5601/index.js?_b=5930:46182:26
callResponseHandlers@http://localhost:5601/index.js?_b=5930:42950:1
fetchWithStrategy/<@http://localhost:5601/index.js?_b=5930:43068:16
qFactory/defer/deferred.promise.then/wrappedCallback@http://localhost:5601/index.js?_b=5930:20873:31
qFactory/defer/deferred.promise.then/wrappedCallback@http://localhost:5601/index.js?_b=5930:20873:31
qFactory/ref/<.then/<@http://localhost:5601/index.js?_b=5930:20959:26
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:5601/index.js?_b=5930:22002:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:5601/index.js?_b=5930:21814:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:5601/index.js?_b=5930:22106:13
done@http://localhost:5601/index.js?_b=5930:17641:34
completeRequest@http://localhost:5601/index.js?_b=5930:17855:7
createHttpBackend/</xhr.onreadystatechange@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d7b2e870-a08e-4944-8203-dca08df62de0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.