Yield called out of block

I use code below in configuration file to create new event,but it is giving exception.

filter {

ruby {
    init => "require 'json'"
    code =>"
         clientValue = event.get('message')
         fieldArray = event.get('message').split('> <')
        for field in fieldArray
            field = field.delete '<'
            field = field.delete '>'
            result = field.split(': ')
           if result[0].include?('clientName')
              clientValArr = result[1].split('/')
              puts clientValArr
              event.set(result[0], clientValArr[0])
              new_event = event.clone
              e =  LogStash::Event.new('tim' => result[0])
              yield e
              puts e
              puts new_event


Duplicate of Create new event in ruby.

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