# How to manage different paths for different hosts

**URL:** <https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 30, 2018, 8:44am UTC](https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584 "2018-10-30T08:44:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arushan](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@arushan](https://discuss.elastic.co/u/arushan)\
**Post date:** [October 30, 2018, 8:44am UTC](https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584/1 "2018-10-30T08:44:42Z")

</div>

Hi,

Im working on to install filebeat in multiple hosts via ansible.

In my case, the log paths are different for each hosts.

So i would like to know how to create a common filebeat config with different paths for different hosts?

---

<div class="post-metadata">

**Author:** ![rijinmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rijinmp/32/24634_2.png) [@rijinmp](https://discuss.elastic.co/u/rijinmp)\
**Post date:** [October 30, 2018, 10:05am UTC](https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584/2 "2018-10-30T10:05:47Z")

</div>

You can mention multiple logs from multiple path like below mentioned method :

> [@rijinmp](#):
>
> You can mention multiple logs from multiple path like below mentioned method :
> 
> filebeat.inputs:
> 
> - type: log  
> paths:
> - /var/log/messages
> - /var/log/\*.log

[quote="rijinmp, post:2, topic:154584, full:true"]  
You can mention multiple logs from multiple path like below mentioned method :

{  
filebeat.inputs:  
- type: log  
paths:  
- /var/log/messages  
- /var/log/\*.log  
}

---

<div class="post-metadata">

**Author:** ![rijinmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rijinmp/32/24634_2.png) [@rijinmp](https://discuss.elastic.co/u/rijinmp)\
**Post date:** [October 30, 2018, 10:06am UTC](https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584/3 "2018-10-30T10:06:34Z")

</div>

For More details , Please refer this link

[https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-log.html)

---

<div class="post-metadata">

**Author:** ![arushan](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@arushan](https://discuss.elastic.co/u/arushan)\
**Post date:** [October 30, 2018, 2:44pm UTC](https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584/4 "2018-10-30T14:44:12Z")

</div>

Thank you rijinmp for the help.

My question is like:

lets say i have three hosts:

[hosts]  
host1  
host2  
host3

and my file beat config file has the following paths:

paths:

- /var/log/xyz/host1/\*log
- /var/log/abc/host2/\*log
- /var/log/klm/host3/\*log

The thing im trying to understand is when i install beats through ansible, it will copy my config file to all hosts which will contain these three paths.  
And when in host1 file beat crawls to /var/log/xyz/host1/\*log and it will find the log being available.  
What will happen when it tries to search for /var/log/abc/host2/\*log and /var/log/klm/host3/\*log in host1 and it doesnt find the location/path/log being not available? Will it cause any error for the file beat handler in host 1?

---

<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:** [November 27, 2018, 2:44pm UTC](https://discuss.elastic.co/t/how-to-manage-different-paths-for-different-hosts/154584/5 "2018-11-27T14:44:22Z")

</div>

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