# Customized logstash ip for each filebeat prospectors

**URL:** <https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 13, 2017, 4:14pm UTC](https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235 "2017-06-13T16:14:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahsa\_b](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@mahsa\_b](https://discuss.elastic.co/u/mahsa_b)\
**Post date:** [June 13, 2017, 4:14pm UTC](https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235/1 "2017-06-13T16:14:59Z")

</div>

Hi  
I was wondering if it's possible to have multiple prospectors to read from different directory and based on that, send the events to a specific logstash.  
ex: I want to read from router-log and send it to :5044  
read from switch log and send it to :5045  
and so on.

the thing is I don't want to send the events to all of the logstashes but the exact specific one.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [June 14, 2017, 11:18pm UTC](https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235/2 "2017-06-14T23:18:36Z")

</div>

It not possible to do event routing in Beats. The best you could do is apply fields or tags to the events on the beats side. Then do the routing in a LS instance based on those tags or just use the `source` value to do routing.

---

<div class="post-metadata">

**Author:** ![mahsa\_b](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@mahsa\_b](https://discuss.elastic.co/u/mahsa_b)\
**Post date:** [June 15, 2017, 2:35pm UTC](https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235/3 "2017-06-15T14:35:28Z")

</div>

Thanks for the answer . could you elaborate a little about " just use the source value to do routing."

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [June 15, 2017, 2:54pm UTC](https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235/4 "2017-06-15T14:54:33Z")

</div>

I was thinking in LS you could use the `source` field which contains the file's full path to conditionally route the event to a particular output.

```auto
output {
  if [source] =~ /some_regex/ {
    elasticsearch { ... }
  } else if [source] =~ /some_other_regex/ {
    elasticsearch { ... }
  }
}

```

---

<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 13, 2017, 2:55pm UTC](https://discuss.elastic.co/t/customized-logstash-ip-for-each-filebeat-prospectors/89235/5 "2017-07-13T14:55:35Z")

</div>

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