Logstash for finding combination of numbers


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

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


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

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.

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