Skip to content

logging in script example not working #2

Description

@ursvasan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions