# Rename field value of int with string name

**URL:** https://discuss.elastic.co/t/rename-field-value-of-int-with-string-name/186769
**Category:** Logstash
**Created:** [June 20, 2019, 9:20pm UTC](https://discuss.elastic.co/t/rename-field-value-of-int-with-string-name/186769 "2019-06-20T21:20:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Lim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_lim/32/45922_2.png) [@John\_Lim](https://discuss.elastic.co/u/John_Lim)
#### Post date: [June 20, 2019, 9:20pm UTC](https://discuss.elastic.co/t/rename-field-value-of-int-with-string-name/186769/1 "2019-06-20T21:20:29Z")

</div>

Hello all,  
Please provide some tips regarding grok mutate issue.

1.) I created a Kibana dashboard but it will make more sense if I can rename the field value. For instance the action type of Web Security Gateway logs shows number (i.e. 0,1,2,3, etc), instead of showing number, how can I convert the value to (0=allowed, 1=denied, etc)..

for example:

filter {  
if [type] == "syslog" {  
grok {  
match =\> { "message" =\> ["%{NUMBER:action\_type} %{GREEDYDATA:protocol}"] }  
remove\_field =\> "message"  
if [action\_type] == 0} {  
mutate {  
replace =\> ["action\_type", "allowed"]  
}  
}  
else if [action\_type] == 1} {  
mutate {  
replace =\> ["action\_type", "denied"]  
.......  
.......  
}  
}  
}  
}

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [June 20, 2019, 9:40pm UTC](https://discuss.elastic.co/t/rename-field-value-of-int-with-string-name/186769/2 "2019-06-20T21:40:00Z")

</div>

The translate filter [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html) has an example similar to this. Make sure you read about the override option on that filter.

---

<div class="post-metadata">

### Author: ![John\_Lim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_lim/32/45922_2.png) [@John\_Lim](https://discuss.elastic.co/u/John_Lim)
#### Post date: [June 25, 2019, 1:58pm UTC](https://discuss.elastic.co/t/rename-field-value-of-int-with-string-name/186769/3 "2019-06-25T13:58:21Z")

</div>

Thanks, appreciate it....

---

<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 23, 2019, 1:58pm UTC](https://discuss.elastic.co/t/rename-field-value-of-int-with-string-name/186769/4 "2019-07-23T13:58:25Z")

</div>

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