# How to make many conditions for one field?

**URL:** <https://discuss.elastic.co/t/how-to-make-many-conditions-for-one-field/227594>\
**Category:** Logstash\
**Created:** [April 11, 2020, 10:23am UTC](https://discuss.elastic.co/t/how-to-make-many-conditions-for-one-field/227594 "2020-04-11T10:23:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emna1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emna1/32/64354_2.png) [@Emna1](https://discuss.elastic.co/u/Emna1)\
**Post date:** [April 11, 2020, 10:23am UTC](https://discuss.elastic.co/t/how-to-make-many-conditions-for-one-field/227594/1 "2020-04-11T10:23:03Z")

</div>

Hi, i want to make many conditions associate to one field, itry this code  
if [Duration] \>= 336 {  
mutate {  
add\_field =\> { "price" =\> "50$" }  
}  
}  
else if [Duration] == 15{  
mutate {  
add\_field =\> { "price" =\> "10$" }  
}  
}  
the output in elasticsearch  
field price show only 50$ , so how can i make many condition in the same field price??

---

<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 9, 2020, 10:23am UTC](https://discuss.elastic.co/t/how-to-make-many-conditions-for-one-field/227594/2 "2020-05-09T10:23:10Z")

</div>

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