# What is expression in script field in Kibana and How to use it?

**URL:** <https://discuss.elastic.co/t/what-is-expression-in-script-field-in-kibana-and-how-to-use-it/84939>\
**Category:** Kibana\
**Created:** [May 8, 2017, 1:20pm UTC](https://discuss.elastic.co/t/what-is-expression-in-script-field-in-kibana-and-how-to-use-it/84939 "2017-05-08T13:20:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartikeya\_sharma\_13](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kartikeya\_sharma\_13](https://discuss.elastic.co/u/kartikeya_sharma_13)\
**Post date:** [May 8, 2017, 1:20pm UTC](https://discuss.elastic.co/t/what-is-expression-in-script-field-in-kibana-and-how-to-use-it/84939/1 "2017-05-08T13:20:38Z")

</div>

I am wondering what is the usage of expression in the drop down of script field in lang option and how can i leverage that option .

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [May 8, 2017, 1:46pm UTC](https://discuss.elastic.co/t/what-is-expression-in-script-field-in-kibana-and-how-to-use-it/84939/2 "2017-05-08T13:46:40Z")

</div>

Hi Kartikeya

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/d/dd0172e696085f2fcf53d47036c21ea91db56fef.png)

The expressions what you see in the drop down is `Lucene expressions`. [http://lucene.apache.org/core/4\_9\_0/expressions/index.html?org/apache/lucene/expressions/js/package-summary.html](http://lucene.apache.org/core/4_9_0/expressions/index.html?org/apache/lucene/expressions/js/package-summary.html)  
Currently Kibana only supports Lucene expressions in script fields, for security reasons.

Here are some additional documentation links : [https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![kartikeya\_sharma\_13](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kartikeya\_sharma\_13](https://discuss.elastic.co/u/kartikeya_sharma_13)\
**Post date:** [May 9, 2017, 12:38pm UTC](https://discuss.elastic.co/t/what-is-expression-in-script-field-in-kibana-and-how-to-use-it/84939/3 "2017-05-09T12:38:19Z")

</div>

Hi Rashmi,

Thanks for the response I was looking into both expression and painless , the only thing which i noticed in either of them is i cannot is comparison operators in painless , rest i guess is same .  
Also Can i use the script fields for extracting other fields . I tried this but got failed.

Thanks

---

<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:** [June 6, 2017, 12:45pm UTC](https://discuss.elastic.co/t/what-is-expression-in-script-field-in-kibana-and-how-to-use-it/84939/4 "2017-06-06T12:45:11Z")

</div>

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