Best way to develop ruby scripts for logstash?

Hi all,

now we are at the point, where simple grok parsing of our logs it not enough. We need to do further aggregations and calculations. I decided to use the ruby filter plugin for that. Also the ruby filter is directly (inside of the code part) adding the results to the event in form of tags or fields.

To speed up the development process I decided to code the ruby part in eclipse, which is working fine except for one part (which should be the same problem if i code ruby in an editor / irp):

Inside logstash's ruby filter i can get an event's field with e.g. s=event['payload'].to_s and I can add fields with event['LWVD_DATA_CODE']=results.

Here is my problem: how can I instanciate a "logstash event" (create my own compatible eventwith the fields I need) which i can use in my ide with the same syntax / usage as the original logstash event?
Currently my workaround is to commont these lines out and check the values inside the debugger or by puts command, but that sucks.

Since I am a noob with ruby don't hesitate to give some details more :wink:

Thanks a lot,

I suggest you write a custom filter plugin instead of writing complex Ruby code in a ruby filter. Then you'll have access to all the APIs, you can write unit tests, and so on.