# Multiple pipelines running on same machine

**URL:** <https://discuss.elastic.co/t/multiple-pipelines-running-on-same-machine/225217>\
**Category:** Logstash\
**Created:** [March 26, 2020, 2:40pm UTC](https://discuss.elastic.co/t/multiple-pipelines-running-on-same-machine/225217 "2020-03-26T14:40:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 26, 2020, 5:39pm UTC](https://discuss.elastic.co/t/multiple-pipelines-running-on-same-machine/225217/2 "2020-03-26T17:39:00Z")

</div>

> [@adityaPsl](#):
>
> does multiple pipelines use the same JVM, are ruby variables shared between two events

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.

---

_[View the full topic](https://discuss.elastic.co/t/multiple-pipelines-running-on-same-machine/225217)._
