# Use filebeat to send different logs in different server

**URL:** https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103
**Category:** Beats
**Tags:** filebeat
**Created:** [April 6, 2018, 1:37pm UTC](https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103 "2018-04-06T13:37:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![adg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adg/32/45618_2.png) [@adg](https://discuss.elastic.co/u/adg)
#### Post date: [April 6, 2018, 1:37pm UTC](https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103/1 "2018-04-06T13:37:24Z")

</div>

in one of my server having filebeat configure currently it send server.log ,localhost.log and localhost-access.log logs to centralized log server via  
/etc/filebeat/filebeat.yml

> output:  
> logstash : [ceterlizedIP:port]  
> index : filebeat  
> filebeat :  
> config\_dir : /etc/filebeat/conf.d

now i have to send localhost-access.log logs to some other server (other then where localhost.log and server.log goes )

so how would i distinguish in filebeat.yml so it have two logstash output and

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [April 6, 2018, 1:50pm UTC](https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103/2 "2018-04-06T13:50:52Z")

</div>

Filebeat only allows to send the data to one output at the time. Your options are:

- Use Logstash to route the events
- Use 2 Filebeat instances, one for each input. In this case make sure you use different data directories.

---

<div class="post-metadata">

### Author: ![adg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adg/32/45618_2.png) [@adg](https://discuss.elastic.co/u/adg)
#### Post date: [April 6, 2018, 2:09pm UTC](https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103/3 "2018-04-06T14:09:24Z")

</div>

i will prefer to go option second , for useing 2 filebeat instance  
but what is mean by different data directories.

does it mean

> config\_dir:

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [April 9, 2018, 7:32am UTC](https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103/4 "2018-04-09T07:32:03Z")

</div>

Here is the data path I was referring to: [https://www.elastic.co/guide/en/beats/filebeat/master/configuration-path.html#\_literal\_data\_literal](https://www.elastic.co/guide/en/beats/filebeat/master/configuration-path.html#_literal_data_literal)

---

<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 7, 2018, 7:32am UTC](https://discuss.elastic.co/t/use-filebeat-to-send-different-logs-in-different-server/127103/5 "2018-05-07T07:32:18Z")

</div>

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