# Is it possible to use a scripted field inside a scripted field

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-inside-a-scripted-field/129598>\
**Category:** Kibana\
**Created:** [April 26, 2018, 7:01am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-inside-a-scripted-field/129598 "2018-04-26T07:01:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dje2006dje](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@dje2006dje](https://discuss.elastic.co/u/dje2006dje)\
**Post date:** [April 26, 2018, 7:01am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-inside-a-scripted-field/129598/1 "2018-04-26T07:01:33Z")

</div>

Hi,  
i need to have a parameter (like a threshold , ie 60 for 60 percent) and in order to avoid to hardcode this one inside my scripted fields using this value , I want create this parameter like a scripted field. like that i don't need to change this value inside all my scripted fields using this one. But unfortunatelly this thing is not working. For example :

```
    working
  ( doc['CPUUtil'].value ) > 60 ? 5 : 0 

   not working
     new created number scripted field : Threshold_A called ( =60)
     ( doc['CPUUtil'].value ) > ( doc['Threshold_A'].value ) ? 5 : 0

```

Do you know if it's possible to use a scripted field inside another one ? Or is it possible to introduce this kind of parameter somewhere in kibana and used it inside a scripted field ?

i have not seen an old (existing) topics (and its answer) about that.

thx

---

<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:** [April 26, 2018, 7:37am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-inside-a-scripted-field/129598/2 "2018-04-26T07:37:06Z")

</div>

No, that is not possible. A scripted field can not refer to other scripted fields.

---

<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 24, 2018, 7:37am UTC](https://discuss.elastic.co/t/is-it-possible-to-use-a-scripted-field-inside-a-scripted-field/129598/3 "2018-05-24T07:37:09Z")

</div>

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