# Calling native plugin from kibana scripted field

**URL:** <https://discuss.elastic.co/t/calling-native-plugin-from-kibana-scripted-field/40139>\
**Category:** Kibana\
**Created:** [January 26, 2016, 4:29pm UTC](https://discuss.elastic.co/t/calling-native-plugin-from-kibana-scripted-field/40139 "2016-01-26T16:29:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phubner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phubner/32/7384_2.png) [@phubner](https://discuss.elastic.co/u/phubner)\
**Post date:** [January 26, 2016, 4:29pm UTC](https://discuss.elastic.co/t/calling-native-plugin-from-kibana-scripted-field/40139/1 "2016-01-26T16:29:14Z")

</div>

The issue I have is simple. I have a native plugin that I wrote (and works fine) but I need to call it from Kibana. However the request that comes from Kibana is defaulted to `"lang":"expression"`. So the question is simple, is there a way to specify, on the "Scripted Fields" tab in Kibana, the lang as "native"?

I did find [this](https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542) which explains how to override the `lang` field that is passed. However that does not get saved or persisted at all.

Info:  
Kibana 4.1.2  
ES 1.5.1

Call generated by Kibana:

```json
[{
	"size": 500,
	"sort": [{
		"timestamp": {
			"order": "desc",
			"unmapped_type": "boolean"
		}
	}],
	"highlight": {
		"pre_tags": ["@kibana-highlighted-field@"],
		"post_tags": ["@/kibana-highlighted-field@"],
		"fields": {
			"*": {}
		},
		"fragment_size": 2147483647
	},
	"aggs": {
		"2": {
			"date_histogram": {
				"field": "timestamp",
				"interval": "30s",
				"pre_zone": "-07:00",
				"pre_zone_adjust_large_interval": true,
				"min_doc_count": 0,
				"extended_bounds": {
					"min": 1453783383534,
					"max": 1453784283534
				}
			}
		}
	},
	"query": {
		"filtered": {
			"query": {
				"match_all": {}
			},
			"filter": {
				"bool": {
					"must": [{
						"range": {
							"timestamp": {
								"gte": 1453783383535,
								"lte": 1453784283535
							}
						}
					}],
					"must_not": []
				}
			}
		}
	},
	"fields": ["*", "_source"],
	"script_fields": {
		"duration_seconds": {
			"script": "duration_seconds",
			"lang": "expression"
		},
		"latency_seconds": {
			"script": "latency_seconds",
			"lang": "expression"
		},
		"duration_minutes": {
			"script": "duration_minutes",
			"lang": "expression"
		}
	},
	"fielddata_fields": ["timestamp", "@timestamp"]
}]

```

---

<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, 2:04pm UTC](https://discuss.elastic.co/t/calling-native-plugin-from-kibana-scripted-field/40139/2 "2017-07-06T14:04:14Z")

</div>


