# Logstash for finding combination of numbers

**URL:** <https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207>\
**Category:** Logstash\
**Created:** [July 20, 2021, 9:30pm UTC](https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207 "2021-07-20T21:30:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shreesh\_Narayanan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreesh_narayanan/32/87312_2.png) [@Shreesh\_Narayanan](https://discuss.elastic.co/u/Shreesh_Narayanan)\
**Post date:** [July 20, 2021, 9:30pm UTC](https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207/1 "2021-07-20T21:30:30Z")

</div>

Hello,

I'm looking for a way to write logstash code for a combination of numbers for a project , example if the input is 5 , the output needs to say 1 + 4 , where 1 means "service stopped" and 4 says "inactive" .

I can define 1 and 4 with mutate , but wanted to know when the input is a combination of above values , how would one design the logstash code

---

<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:** [July 21, 2021, 1:22am UTC](https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207/2 "2021-07-21T01:22:50Z")

</div>

Are you saying you want to convert a decimal integer to binary?

---

<div class="post-metadata">

**Author:** ![Shreesh\_Narayanan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shreesh_narayanan/32/87312_2.png) [@Shreesh\_Narayanan](https://discuss.elastic.co/u/Shreesh_Narayanan)\
**Post date:** [July 21, 2021, 10:10am UTC](https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207/3 "2021-07-21T10:10:59Z")

</div>

hello,

No, not into any specific types . I have a predefined set of numbers (1,4,6) each of these mean something , the log line has a field that prints the consolidated number such as 5 in case of issues.

So when "5" is indicated, it is a combination of flags 1 and 4 . I'm looking for a way to do this on logstash to print that 5 is a combination of 1-service-stopped and 4-inactive

---

<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:** [July 21, 2021, 4:50pm UTC](https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207/4 "2021-07-21T16:50:53Z")

</div>

If the only values that the field can have are 1, 4, 6, 5, 7, 10, 11 then maybe you could do it using a translate filter.

---

<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 18, 2021, 4:51pm UTC](https://discuss.elastic.co/t/logstash-for-finding-combination-of-numbers/279207/5 "2021-08-18T16:51:12Z")

</div>

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