# Can filebeat send to different LS servers based on hostname criteria

**URL:** <https://discuss.elastic.co/t/can-filebeat-send-to-different-ls-servers-based-on-hostname-criteria/157028>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 16, 2018, 10:53am UTC](https://discuss.elastic.co/t/can-filebeat-send-to-different-ls-servers-based-on-hostname-criteria/157028 "2018-11-16T10:53:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [November 16, 2018, 1:57pm UTC](https://discuss.elastic.co/t/can-filebeat-send-to-different-ls-servers-based-on-hostname-criteria/157028/2 "2018-11-16T13:57:18Z")

</div>

> PS : limitation might be the same as [Can filebeat be configured to send to different ES or logstash servers?](https://discuss.elastic.co/t/can-filebeat-be-configured-to-send-to-different-es-or-logstash-servers/41503/1)

Right. Filebeat does not support event routing.

You could provide the filebeat configuration as a template and have your provisioning system (or some custom startup script) create the final per machine configuration from your template.

One can also use variables like this:

```auto
output.logstash:
  hosts: ["${LOGSTASH_HOST}"]

```

Variables can be either set via:

- environment variables
- another configuration file and start filebeat with multiple config files: (e.g. `filebeat -c main.yml -c vars.yml` )
- add variable to startup command: (e.g. `filebeat -E LOGSTASH_HOST=...`)
- having provisioning, just append variables to end of the config file like (`echo LOGSTASH_HOST: ...` \>\> /etc/filebeat/filebeat.yml)

---

_[View the full topic](https://discuss.elastic.co/t/can-filebeat-send-to-different-ls-servers-based-on-hostname-criteria/157028)._
