Multiple pipelines running on same machine

Yes, pipelines in the same logstash instance run in the same JVM. Where variables in ruby filters are shared depends on the scope with which you declare them. Global variables ($name) are shared globally. You should never need that. Class variables (@@name) are shared across all ruby filters. It is not every year I need a class variable and I write a lot more ruby filters that most folks. Instance variables (@name) are shared by different events within a single ruby filter. Sometimes I use instance variables but most of the time I just use regular variables (name) that just exist for the duration of the execution of the code block for an event.

1 Like