# Kibana Scripted Field

**URL:** <https://discuss.elastic.co/t/kibana-scripted-field/177656>\
**Category:** Kibana\
**Created:** [April 19, 2019, 6:31pm UTC](https://discuss.elastic.co/t/kibana-scripted-field/177656 "2019-04-19T18:31:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rishi\_tosh\_Guha](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@Rishi\_tosh\_Guha](https://discuss.elastic.co/u/Rishi_tosh_Guha)\
**Post date:** [April 19, 2019, 6:31pm UTC](https://discuss.elastic.co/t/kibana-scripted-field/177656/1 "2019-04-19T18:31:35Z")

</div>

```auto
def path = doc['Extra_Data.keyword'].value;
def ls=[];
if(path.endsWith('L 9')) {
 ls.add(doc['LogEntry_Time.keyword'].value);
 }
if (ls !=null){
 def x = ls.get(0);
 return "x";
}
return "y";

```

Hello,  
i got this error .  
why my scripted field is not working?  
I would love to know your suggestion.  
and Do you know why some of groovy syntax is not working in scripted field?

Thank You

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [April 19, 2019, 10:13pm UTC](https://discuss.elastic.co/t/kibana-scripted-field/177656/2 "2019-04-19T22:13:49Z")

</div>

Hi there,

Could you give me some more context on "is not working"? Are you getting an error or is the field just not evaluating to what you would expect? Have you tried using the built-in script testing tool in the scripted fields editor to test your changes?

---

<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:** [May 17, 2019, 10:22pm UTC](https://discuss.elastic.co/t/kibana-scripted-field/177656/3 "2019-05-17T22:22:54Z")

</div>

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