Debugging scripts

I know it's a bit late, but you should try this:
https://www.elastic.co/blog/elasticsearch-logging-secrets