Ruby exception occurred

I am getting the error

[2017-10-24T17:20:25,702][ERROR][logstash.filters.ruby ] Ruby exception occurred: invalid byte sequence in UTF-8

My ruby filter is:

       ruby {
              # isolate the server name from the "source" field
              # adding the field 'inputserver'
              code => "
                       event.set('inputserver', event.get('source').split('/')[4])
                       require 'csv'
                       CSV.foreach('/home/vpwrk1/LogStash/impls/logstash/cmerrortype.csv') do |rec|
                         if rec[0] == event.get('errorcodeiffailure')
                            event.set('exceptiontype', rec[1])

Any idea?


Issue solved.

The csv input file had to be converted to UTF-8 before been used.

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