# Groovy in kibana

**URL:** <https://discuss.elastic.co/t/groovy-in-kibana/47189>\
**Category:** Kibana\
**Created:** [April 13, 2016, 5:44am UTC](https://discuss.elastic.co/t/groovy-in-kibana/47189 "2016-04-13T05:44:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirthi13](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@Kirthi13](https://discuss.elastic.co/u/Kirthi13)\
**Post date:** [April 13, 2016, 5:44am UTC](https://discuss.elastic.co/t/groovy-in-kibana/47189/1 "2016-04-13T05:44:36Z")

</div>

Hi Team,

I am new to kibana just started working on it.I want to know how to use groovy script in kibana.  
i tried below command in search  
{ "filtered" : { "filter" : { "script" : { "script" : "groovy.txt" } } } }  
i got error stating "failed to run inline script [groovy.txt] using lang [groovy]".

Can anyone help on this issue ?

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [April 13, 2016, 9:49pm UTC](https://discuss.elastic.co/t/groovy-in-kibana/47189/2 "2016-04-13T21:49:58Z")

</div>

If you want to run a script that's in a file you'll need to place it in the correct directory under Elasticsearch's home and use a query body like this:

```auto
{
  "script_fields": {
    "my_field": {
      "script": {
        "file": "my_script",
        "params": {
          "my_var": 2
        }
      }
    }
  }
}

```

You'll probably want to check out the docs on scripting here [https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-scripting.html)

---

<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:** [July 6, 2017, 1:56pm UTC](https://discuss.elastic.co/t/groovy-in-kibana/47189/3 "2017-07-06T13:56:09Z")

</div>


