# How do you print a value of a variable in the source script?

**URL:** https://discuss.elastic.co/t/how-do-you-print-a-value-of-a-variable-in-the-source-script/297160
**Category:** Kibana
**Created:** [February 14, 2022, 3:40pm UTC](https://discuss.elastic.co/t/how-do-you-print-a-value-of-a-variable-in-the-source-script/297160 "2022-02-14T15:40:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Marco\_Ramos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_ramos/32/101550_2.png) [@Marco\_Ramos](https://discuss.elastic.co/u/Marco_Ramos)
#### Post date: [February 14, 2022, 3:40pm UTC](https://discuss.elastic.co/t/how-do-you-print-a-value-of-a-variable-in-the-source-script/297160/1 "2022-02-14T15:40:32Z")

</div>

how do you print a value of a variable in the source script?

---

<div class="post-metadata">

### Author: ![majagrubic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/majagrubic/32/74459_2.png) [@majagrubic](https://discuss.elastic.co/u/majagrubic)
#### Post date: [February 16, 2022, 7:35am UTC](https://discuss.elastic.co/t/how-do-you-print-a-value-of-a-variable-in-the-source-script/297160/2 "2022-02-16T07:35:54Z")

</div>

Console-like output is not allowed by Painless (see more info as to why that is [here](https://github.com/elastic/elasticsearch/issues/20263)). The intended usage is that you emit a value that you are interested in.

---

<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: [March 16, 2022, 7:36am UTC](https://discuss.elastic.co/t/how-do-you-print-a-value-of-a-variable-in-the-source-script/297160/3 "2022-03-16T07:36:34Z")

</div>

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