# How to validate painless scripts?

**URL:** <https://discuss.elastic.co/t/how-to-validate-painless-scripts/114004>\
**Category:** Elasticsearch\
**Created:** [January 4, 2018, 2:58am UTC](https://discuss.elastic.co/t/how-to-validate-painless-scripts/114004 "2018-01-04T02:58:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunil\_purushothaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunil_purushothaman/32/21596_2.png) [@sunil\_purushothaman](https://discuss.elastic.co/u/sunil_purushothaman)\
**Post date:** [January 4, 2018, 2:58am UTC](https://discuss.elastic.co/t/how-to-validate-painless-scripts/114004/1 "2018-01-04T02:58:13Z")

</div>

We use many ScriptQuery and ScriptField in our project, and provide inline scripts for them in painless language.

My question is, how can we validate these painless scripts? In other words, how to make sure that they will compile ?

The approach we use today is to test them out locally through kibana. However, this is manual, error prone and not scalable. I am looking for a programmatic way to validate painless scripts.  
Is the compile elasticsearch uses under the hood open source ? Or is there some other way ?

Elasticsearch version 5.4

---

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [January 4, 2018, 5:21am UTC](https://discuss.elastic.co/t/how-to-validate-painless-scripts/114004/2 "2018-01-04T05:21:55Z")

</div>

There's an open issue to provide a [Painless execution endpoint](https://github.com/elastic/elasticsearch/issues/27875) which could very well do the compilation/simulation job you're expecting. However, it's still under discussion and there's no guarantee that it will ever be implemented.

You can chime in and give it a thumbs up to show your interest, though.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 1, 2018, 5:22am UTC](https://discuss.elastic.co/t/how-to-validate-painless-scripts/114004/3 "2018-02-01T05:22:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
