# Kibana4 scripted field array access

**URL:** <https://discuss.elastic.co/t/kibana4-scripted-field-array-access/2275>\
**Category:** Kibana\
**Created:** [June 10, 2015, 7:23am UTC](https://discuss.elastic.co/t/kibana4-scripted-field-array-access/2275 "2015-06-10T07:23:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lwintergerst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lwintergerst/32/18164_2.png) [@lwintergerst](https://discuss.elastic.co/u/lwintergerst)\
**Post date:** [June 10, 2015, 7:23am UTC](https://discuss.elastic.co/t/kibana4-scripted-field-array-access/2275/1 "2015-06-10T07:23:17Z")

</div>

Hello,

i have the following field:  
"load\_average": [2.57, 2.2, 2.18],  
this is the JSON.

I now want to use scripted fields to generate separate fields so I can visualize the loads separately.

What I tried so far is:  
doc["os.load\_average"].value[1]

This does give me the first value.  
But so does:  
doc["os.load\_average"].value[2]

Is there any other way to get a specific value in an array?

Kind Regards,  
Luca

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [June 17, 2015, 5:08am UTC](https://discuss.elastic.co/t/kibana4-scripted-field-array-access/2275/2 "2015-06-17T05:08:21Z")

</div>

By default Kibana 4 scripted fields use [Lucene expressions](http://lucene.apache.org/core/4_9_0/expressions/index.html?org/apache/lucene/expressions/js/package-summary.html), which currently only operate on numeric fields.

You can turn on static Groovy scripts, which have more advanced scripting functionality (note dynamic Groovy scripts are no longer recommended) -- for more discussion on how to do that in Kibana 4 please see [this thread](https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542/3).

---

<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:18pm UTC](https://discuss.elastic.co/t/kibana4-scripted-field-array-access/2275/3 "2017-07-06T14:18:01Z")

</div>


