# Logstash the number of out events is exactly double the number of in events

**URL:** <https://discuss.elastic.co/t/logstash-the-number-of-out-events-is-exactly-double-the-number-of-in-events/171861>\
**Category:** Logstash\
**Created:** [March 12, 2019, 5:25am UTC](https://discuss.elastic.co/t/logstash-the-number-of-out-events-is-exactly-double-the-number-of-in-events/171861 "2019-03-12T05:25:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bbking/32/77563_2.png) [@bbking](https://discuss.elastic.co/u/bbking)\
**Post date:** [March 12, 2019, 5:25am UTC](https://discuss.elastic.co/t/logstash-the-number-of-out-events-is-exactly-double-the-number-of-in-events/171861/1 "2019-03-12T05:25:22Z")

</div>

Hi, I'm trying to understand the metrics returned by `_node/stats/pipelines` in logstash. I'm quite confused why the number of out events is exactly doubles the number of in events. Shouldn't it be the same? `main` is the pipleline I used, its configuration file is below:

```auto
input {
    beats {
        port => "5044"
        host => "${HOSTNAME}"
    }
}

filter {
  ruby {
   # this filter takes an event and return an empty event array or an array with single event
  # it shouldn't be the reasonof double number of out events.
    path => "./parse_instances.rb"
  }

  date {
    match => ["time", "EEE MMM dd HH:mm:ss z yyyy"]
    remove_field => ["time"]
  }
}

output {
  if [message] {
    elasticsearch {
      template => "./failure.json"
      template_name => "failure"
      hosts => ["localhost:9200"]
      index => "failure-%{+yyyy}"
    }
  }
  else {
    elasticsearch {
      template => "./success.json"
      template_name => "success"
      hosts => ["localhost:9200"]
      index => "success-%{+yyyy}"
    }
  }
}

```

Metrics:

```auto
    "main" : {
      "events" : {
        "duration_in_millis" : 8765,
        "in" : 1066,
        "out" : 2132,
        "filtered" : 2132,
        "queue_push_duration_in_millis" : 0
      },
      "plugins" : {
        "inputs" : [ {
          "id" : "14c41567c86423438cefc7d9c899fef42411103535961a93a24df",
          "events" : {
            "out" : 1066,
            "queue_push_duration_in_millis" : 0
          },
          "current_connections" : 0,
          "name" : "beats",
          "peak_connections" : 1
        } ],
        "filters" : [ {
          "id" : "caaf3633f39897fe41837858c0dbe3bded9b072b8e73d90c2447388991",
          "events" : {
            "duration_in_millis" : 252,
            "in" : 2132,
            "out" : 1066
          },
          "matches" : 1066,
          "name" : "date"
        }, {
          "id" : "607eb7136bcd2626d9f2c111cbfc0ff9da96a94f5d7bf3d07a04528",
          "events" : {
            "duration_in_millis" : 4847,
            "in" : 1066,
            "out" : 1066
          },
          "name" : "ruby"
        } ],
        "outputs" : [ {
          "id" : "3dc66707f76e38d6a9aa3d99349fdd54200fb89fb518c5a9375351a4a1",
          "documents" : {
            "successes" : 48
          },
          "events" : {
            "duration_in_millis" : 903,
            "in" : 48,
            "out" : 48
          },
          "bulk_requests" : {
            "successes" : 12,
            "responses" : {
              "200" : 12
            }
          },
          "name" : "elasticsearch"
        }, {
          "id" : "c20ee0cbdd30d9089b283c5ad18ad8c726c7e8e2cac8b7b090ed6",
          "documents" : {
            "successes" : 1018
          },
          "events" : {
            "duration_in_millis" : 2632,
            "in" : 1018,
            "out" : 1018
          },
          "bulk_requests" : {
            "successes" : 24,
            "responses" : {
              "200" : 24
            }
          },
          "name" : "elasticsearch"
        } ]
      },

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 9, 2019, 5:25am UTC](https://discuss.elastic.co/t/logstash-the-number-of-out-events-is-exactly-double-the-number-of-in-events/171861/2 "2019-04-09T05:25:22Z")

</div>

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