elasticsearch-test-scripts icon indicating copy to clipboard operation
elasticsearch-test-scripts copied to clipboard

logging in script example not working

Open ursvasan opened this issue 10 years ago • 0 comments

Hi

I tried your example in

https://github.com/imotov/elasticsearch-test-scripts/blob/master/logging_from_script.sh

It doesnt seem to work. I get the following error

$ curl "localhost:9200/test/doc/_search" -d '{

"script_fields": {
    "test": {
        "script": "org.elasticsearch.common.logging.Loggers.getLogger(\"my_logger\").info(\"here comes a script {}\", 42); 42"
    }
}

}' {"error":"SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[3QnDqjsSS6G-4yGDWwvcNw][test][0]: CompileException[[Error: null]\n[Near : {... org.elasticsearch.common.loggi ....}]\n ^\n[Line: 1, Column: 1]]; nested: NegativeArraySizeException; }]","status":500} $ echo

When I searched around a little bit i saw this forum post http://elasticsearch-users.115913.n3.nabble.com/Debugging-scripts-td4055997.html In this post the user says it works only with java 1.6 and not with java 1.7. I have java 1.7.

It would be really helpful if i can get some logging in the script, else i have no clue whats going wrong inside the script.

ursvasan avatar Aug 27 '14 23:08 ursvasan