# Alter vs Translate vs If/Else statements

**URL:** https://discuss.elastic.co/t/alter-vs-translate-vs-if-else-statements/98466
**Category:** Logstash
**Created:** [August 27, 2017, 6:40am UTC](https://discuss.elastic.co/t/alter-vs-translate-vs-if-else-statements/98466 "2017-08-27T06:40:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![neu5ron](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@neu5ron](https://discuss.elastic.co/u/neu5ron)
#### Post date: [August 27, 2017, 6:40am UTC](https://discuss.elastic.co/t/alter-vs-translate-vs-if-else-statements/98466/1 "2017-08-27T06:40:31Z")

</div>

I am trying to determine what is the fastest/most-efficient/recommendation (I was thinking of either using Translate, Alter, or just If/Else statements) for performing actions on data such as the following.  
$field has values of 7,8, and 9.  
7 = Log  
8 = Block  
9 = Bypass  
\*\*\*\*The content would not be dynamic such as [https://www.elastic.co/blog/bro-ids-elastic-stack](https://www.elastic.co/blog/bro-ids-elastic-stack) where it was using a translate dictionary-path for TOR IPs.

I want to convert each "key"(integer) to its corresponding value... But as stated above, there seems to be 3 filters/options that may accomplish this.

---

<div class="post-metadata">

### Author: ![neu5ron](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@neu5ron](https://discuss.elastic.co/u/neu5ron)
#### Post date: [September 5, 2017, 5:47pm UTC](https://discuss.elastic.co/t/alter-vs-translate-vs-if-else-statements/98466/2 "2017-09-05T17:47:01Z")

</div>

I will close this..  
Just going to chalk it up to I just need to test this myself by using metrics or some such.

---

<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: [October 3, 2017, 5:47pm UTC](https://discuss.elastic.co/t/alter-vs-translate-vs-if-else-statements/98466/3 "2017-10-03T17:47:31Z")

</div>

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