# Multi filebeat send log to 1 logstash

**URL:** <https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730>\
**Category:** Logstash\
**Created:** [December 22, 2016, 3:10am UTC](https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730 "2016-12-22T03:10:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tr\_ng\_Trang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tr_ng_trang/32/13053_2.png) [@Tr\_ng\_Trang](https://discuss.elastic.co/u/Tr_ng_Trang)\
**Post date:** [December 22, 2016, 3:10am UTC](https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730/1 "2016-12-22T03:10:44Z")

</div>

i want to use file beat in 2 server difference to send log from 2 file in each server to 1 server have logstash running on. How i configure in logstash configure file to determine exactly for each file beat then can to handle by grok for each file log?

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [December 22, 2016, 9:17am UTC](https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730/2 "2016-12-22T09:17:03Z")

</div>

the events (log lines) sent by filebeat will contain metadata like host and filename.  
you can use that metadata to create conditionals on logstash to run different grok patterns.

```auto
filter {
  if [host] == "host1.local.lan" {
    grok { .. }
  } else {
    grok { .. }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Tr\_ng\_Trang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tr_ng_trang/32/13053_2.png) [@Tr\_ng\_Trang](https://discuss.elastic.co/u/Tr_ng_Trang)\
**Post date:** [December 23, 2016, 2:29am UTC](https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730/3 "2016-12-23T02:29:42Z")

</div>

thanks you guys,  
i have another question, can i have 2 file log send by 1 filebeat ? and how to grok can determine it ?

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [December 23, 2016, 10:37am UTC](https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730/4 "2016-12-23T10:37:29Z")

</div>

it's the same principle, you can configure filebeat to read two files [documentation here](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html#_paths)  
and then use the path field of the log line events you receive in logstash to apply conditionals to determine with filters/outputs to use.

---

<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:** [January 20, 2017, 10:37am UTC](https://discuss.elastic.co/t/multi-filebeat-send-log-to-1-logstash/69730/5 "2017-01-20T10:37:48Z")

</div>

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