# File output plugin of logstash to capture the drop events

**URL:** <https://discuss.elastic.co/t/file-output-plugin-of-logstash-to-capture-the-drop-events/82833>\
**Category:** Logstash\
**Created:** [April 19, 2017, 7:41am UTC](https://discuss.elastic.co/t/file-output-plugin-of-logstash-to-capture-the-drop-events/82833 "2017-04-19T07:41:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![santhosh244](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@santhosh244](https://discuss.elastic.co/u/santhosh244)\
**Post date:** [April 19, 2017, 7:41am UTC](https://discuss.elastic.co/t/file-output-plugin-of-logstash-to-capture-the-drop-events/82833/1 "2017-04-19T07:41:11Z")

</div>

Below is the scenario:

We are dropping events in filter section if log\_level are DEBUG and that is getting properly dropped and not sent to ES.

But we would like to capture those events in a flat file using file output plugin. But it is not working.

if ([log\_level] == "INFO"){  
drop {}  
}

We have the file plugin in outfile file. Any suggestion on this requirement.

Version of Components:

elasticsearch-2.1.1,logstash-2.1.1, kibana-4.3.1-linux-x64, and filebeat-1.2.0-1.x86\_64

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 19, 2017, 10:47am UTC](https://discuss.elastic.co/t/file-output-plugin-of-logstash-to-capture-the-drop-events/82833/2 "2017-04-19T10:47:35Z")

</div>

Dropped events are dropped and don't reach any output. Instead of the drop filter, structure your outputs like this:

```nohighlight
if [log_level] == "INFO" {
  file {
    ...
  }
} else {
  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:** [May 17, 2017, 10:56am UTC](https://discuss.elastic.co/t/file-output-plugin-of-logstash-to-capture-the-drop-events/82833/3 "2017-05-17T10:56:12Z")

</div>

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