How to convert a boolean value to string when ingesting with Logstash

Hi,

I have a CSV file that I am currently ingesting via Logstash. I have a column 'Status' with 0 and 1 value.

Currently I am ingesting this Status column as a boolean value and as a result of which I am getting True / False values.

I want to ingest the values as 'Pass' and 'Fail' (for 0 and 1 respectively). Is there any way in Logstash to do this?
In Kibana, how can I show Pass / Fail labels instead of False / True?

I don't believe there's anything built-in for this but you can always use a ruby filter.

Thanks Magnus. It will be great if you can help me with a small code snippet?

Untested:

event.set('fieldname', event.get('fieldname') ? 'pass' : 'fail')

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