# Auto replacement, bind numbers to words

**URL:** <https://discuss.elastic.co/t/auto-replacement-bind-numbers-to-words/189084>\
**Category:** Kibana\
**Created:** [July 5, 2019, 11:29am UTC](https://discuss.elastic.co/t/auto-replacement-bind-numbers-to-words/189084 "2019-07-05T11:29:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![test\_qweqwe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/test_qweqwe/32/94750_2.png) [@test\_qweqwe](https://discuss.elastic.co/u/test_qweqwe)\
**Post date:** [July 5, 2019, 11:29am UTC](https://discuss.elastic.co/t/auto-replacement-bind-numbers-to-words/189084/1 "2019-07-05T11:29:00Z")

</div>

I have field "severity" where my "values" are: 10,20,30,40,50,60,70,80,90.100 where  
10 - NO IMPACT  
20,30 - LOW  
40,50,60 - MEDIUM  
80,90,100 - HIGH

How to build search that will make auto replacement numbers to words?

---

<div class="post-metadata">

**Author:** ![test\_qweqwe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/test_qweqwe/32/94750_2.png) [@test\_qweqwe](https://discuss.elastic.co/u/test_qweqwe)\
**Post date:** [July 5, 2019, 11:42am UTC](https://discuss.elastic.co/t/auto-replacement-bind-numbers-to-words/189084/2 "2019-07-05T11:42:30Z")

</div>

As I understand it is impossible to do via Kibana? Yes?

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [July 5, 2019, 8:42pm UTC](https://discuss.elastic.co/t/auto-replacement-bind-numbers-to-words/189084/3 "2019-07-05T20:42:21Z")

</div>

So you want to query for something like `HIGH` and get any values that are `89, 90, 100`?

If so, you could do this using [scripted fields](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) in Kibana. You could set up a script that returns your desired string based on the severity number value, and instead of querying the severity directly, you can simply query your scripted field.

Some pseudocode:

```auto
def sev = doc['severity'].value;
if (sev <= 10) {
   return "NO IMPACT"
} else {
   return "whatever"
}
// etc

```

---

<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:** [August 2, 2019, 8:42pm UTC](https://discuss.elastic.co/t/auto-replacement-bind-numbers-to-words/189084/4 "2019-08-02T20:42:22Z")

</div>

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