# Coexistence with logstash-forwarder

**URL:** <https://discuss.elastic.co/t/coexistence-with-logstash-forwarder/33632>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 3, 2015, 1:22pm UTC](https://discuss.elastic.co/t/coexistence-with-logstash-forwarder/33632 "2015-11-03T13:22:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 3, 2015, 1:42pm UTC](https://discuss.elastic.co/t/coexistence-with-logstash-forwarder/33632/2 "2015-11-03T13:42:35Z")

</div>

Use conditionals to select which output(s) to use. Presumably there is some field (perhaps `[@metadata][beat]` that's unique for Beats-generated events.

```
output {
  if [@metadata][beat] {
    elasticsearch {
      hosts => ["http://localhost:9200"]
      index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
      document_type => "%{[@metadata][type]}"
    }
  } else {
    # non-Beats outputs
  }
}
```

---

_[View the full topic](https://discuss.elastic.co/t/coexistence-with-logstash-forwarder/33632)._
