# Logstash: call native script in elastic?

**URL:** <https://discuss.elastic.co/t/logstash-call-native-script-in-elastic/36254>\
**Category:** Logstash\
**Created:** [December 3, 2015, 7:53am UTC](https://discuss.elastic.co/t/logstash-call-native-script-in-elastic/36254 "2015-12-03T07:53:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcelHallmann](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@MarcelHallmann](https://discuss.elastic.co/u/MarcelHallmann)\
**Post date:** [December 3, 2015, 7:53am UTC](https://discuss.elastic.co/t/logstash-call-native-script-in-elastic/36254/1 "2015-12-03T07:53:54Z")

</div>

Hi,

I wrote a java plugin for elasticsearch as described in [Scripting | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html).

Now I want logstash to call this plugin in the elasticsearch-output part:

```
output {
 elasticsearch {
        // host/port and such things
        action => "index"
        script => "my_script"
        script_lang => "native"
   }
}

```

When I start this, I get an exception that the script could not be found :

> "status"=\>400, "error"=\>"ElasticsearchIllegalArgumentException[failed to execute script]; nested: ElasticsearchIllegalArgumentException[Unable to find on disk script upsert\_script];

What is the correct way to call the native script?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 3, 2015, 8:05am UTC](https://discuss.elastic.co/t/logstash-call-native-script-in-elastic/36254/2 "2015-12-03T08:05:24Z")

</div>

The Elasticsearch output plugin does not currently support calling native scripts. The parameters you have tried specifying do not exist according to the [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html). There is a [pull request](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/235) that aims to add support for this, and it looks like it is being reviewed.

---

<div class="post-metadata">

**Author:** ![MarcelHallmann](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@MarcelHallmann](https://discuss.elastic.co/u/MarcelHallmann)\
**Post date:** [December 3, 2015, 10:13am UTC](https://discuss.elastic.co/t/logstash-call-native-script-in-elastic/36254/3 "2015-12-03T10:13:52Z")

</div>

Yes, I've already cloned that plugin and using it, but I couldn't figure out how to call the Java code.  
Calling groovy code did work, but not with Java.

---

<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, 5:20am UTC](https://discuss.elastic.co/t/logstash-call-native-script-in-elastic/36254/4 "2017-07-06T05:20:13Z")

</div>


