lib/logstash/codecs/cef.rb
# Escape pipes and backslashes in the header. Equal signs are ok.
# Newlines are forbidden.
Escape pipes and backslashes in the header. Equal signs are ok.
Newlines are forbidden.
Escape pipes and backslashes in the header . Equal signs are ok . Newlines are forbidden .
def sanitize_header_field(value)
    output = ""
    value = value.to_s.gsub(/\r\n/, "\n")
    value.each_char{|c|
      case c
      when "\\", "|"
        output += "\\" + c
      when "\n", "\r"
        output += " "
      else
        output += c
      end
    }
    return output
  end
def sanitize_header_field ( value ) output = "" value = value . to_s . gsub ( / \r \n / , "\n" ) value . each_char { | c | case c when "\\" , "|" output += "\\" + c when "\n" , "\r" output += " " else output += c end } return output end
Escape pipes and backslashes in the header.
Escape pipes and backslashes in the header .
value