# Multiple Filebeat instance

**URL:** <https://discuss.elastic.co/t/multiple-filebeat-instance/71904>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 17, 2017, 8:03pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904 "2017-01-17T20:03:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 17, 2017, 8:03pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/1 "2017-01-17T20:03:51Z")

</div>

I am using Filebeat 5.1 on Centos Linux and have following constraints =\>

1. need to run multiple Filebeat instances on same hosts.
2. Each instance shall work with its own config yml.
3. Start and stop individual Filebeat instances without affecting other instances.

Can anybody provide more details how to achieve any of the above requirements ?

Also, it will be helpful to know whether there is any API by which I can start/stop Filebeat.  
Using /etc/init.d/filebeat restart command somewhat not really good way to start/stop process on production hosts.

Thanks

---

<div class="post-metadata">

**Author:** ![vld](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@vld](https://discuss.elastic.co/u/vld)\
**Post date:** [January 18, 2017, 12:58pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/2 "2017-01-18T12:58:54Z")

</div>

Why do you need more instances? What is your use case?  
I also investigated how to have multiple instances. No result. Finally I was able to use only one for all my use cases.

---

<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:** [January 18, 2017, 1:16pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/3 "2017-01-18T13:16:04Z")

</div>

Running multiple instances should not be a problem. Just make sure they use different registry files.

---

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 18, 2017, 4:27pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/4 "2017-01-18T16:27:37Z")

</div>

@ruflin  
With default Filebeat interface (/etc/init.d/filebeat on Linux) , I can not create multiple instances.  
Start / Stop arguments to script start/stop only one instance. Also, it always use default YML config (/etc/filebeat/filebeat.yml) even if I use different config through -c argument.

How to start multiple instances here ?

---

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [January 18, 2017, 6:13pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/5 "2017-01-18T18:13:39Z")

</div>

@Vid  
I want to monitor log files for multiple applications producing different types of logs in production.  
Logs for some apps need to be streamed to Logstash and for others to Kafka.  
It makes easy to manage my requirements with multiple Filebeat instances .  
If one Filebeat instance stops/slows down, others shall not be affected.

---

<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:** [January 18, 2017, 10:23pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/6 "2017-01-18T22:23:15Z")

</div>

which init system is your distribution using? The /etc/init.d/filebeat file is mostly used as fallback if the distribution is not using systemd. That is you likely have edited the wrong file?

---

<div class="post-metadata">

**Author:** ![pc2856](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pc2856](https://discuss.elastic.co/u/pc2856)\
**Post date:** [February 4, 2017, 12:34am UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/7 "2017-02-04T00:34:22Z")

</div>

@ruflin  
I am using Filebeat 5.1 on Centos Linux .  
To run multiple instances of Filebeat , I use binary of Filebeat (located at /usr/share/filebeat/bin/filebeat)

Here is command to run : " /usr/share/filebeat/bin/filebeat -c & "  
I am not using default wrapper to run Filebeat.  
As I run it in background, I get PID for filebeat process. I use this PID to stop/kill filebeat process whenever required.

Is this correct way to stop filebeat by killing its process ?  
Or there is any other way to run multiple instances

---

<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:** [February 7, 2017, 3:19pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/8 "2017-02-07T15:19:25Z")

</div>

This should work. Did you hit any issues?

---

<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:** [March 7, 2017, 3:19pm UTC](https://discuss.elastic.co/t/multiple-filebeat-instance/71904/9 "2017-03-07T15:19:30Z")

</div>

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