# Specify windows logs

**URL:** <https://discuss.elastic.co/t/specify-windows-logs/45156>\
**Category:** Logstash\
**Created:** [March 22, 2016, 8:29pm UTC](https://discuss.elastic.co/t/specify-windows-logs/45156 "2016-03-22T20:29:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![augusto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/augusto/32/13377_2.png) [@augusto](https://discuss.elastic.co/u/augusto)\
**Post date:** [March 22, 2016, 8:29pm UTC](https://discuss.elastic.co/t/specify-windows-logs/45156/1 "2016-03-22T20:29:50Z")

</div>

Hello,  
sorry, but i can't find some answer in the forum about my doubt.

I want to send only error and warning logs to logstash from Windows Server (using nxlog), it's possible filter on logstash? To exclude all is not error, critical or warning?

I try to put the configuration directly on the agent, but without sucessfull.

I'm try to use this configuration: [http://serverfault.com/questions/543494/query-specific-logs-from-event-log-using-nxlog](http://serverfault.com/questions/543494/query-specific-logs-from-event-log-using-nxlog)

Thanks so much.

---

<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:** [March 22, 2016, 8:42pm UTC](https://discuss.elastic.co/t/specify-windows-logs/45156/2 "2016-03-22T20:42:40Z")

</div>

Yes, you can conditionally drop events in Logstash, e.g. like this:

```auto
filter {
  if [level] not in ["error", "critical", "warning"] {
    drop { }
  }
}

```

This obviously assumes that the loglevel is available in the `level` field. See [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html) for more examples.

---

<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:** [July 6, 2017, 5:05am UTC](https://discuss.elastic.co/t/specify-windows-logs/45156/3 "2017-07-06T05:05:50Z")

</div>

Closed on July 6, 2017, 5:05am UTC


