Currently debugging any scripted field is a big hassle. You have to update the field and navigate all the way to the discover page or your visualization in order to see if it works.
What I would suggest is a "Test" button inside the script editor, just so you know if your scripted field is OK instead of running it in Discover. It would just query Elastic on one document from that index pattern so that wouldn't put too much strain on the server and get you a very quick run time.
Another good place to have this (on top of the previous one) would be as a "Scripted Field IDE" inside the DevTools.
Currently debugging any scripted field is a big hassle. You have to update the field and navigate all the way to the discover page or your visualization in order to see if it works.
What I would suggest is a "Test" button inside the script editor, just so you know if your scripted field is OK instead of running it in Discover. It would just query Elastic on one document from that index pattern so that wouldn't put too much strain on the server and get you a very quick run time.
Another good place to have this (on top of the previous one) would be as a "Scripted Field IDE" inside the DevTools.