# How to configure filebeat to read data from several paths using a path varible in it's configuration?

**URL:** <https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 19, 2017, 5:01am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355 "2017-05-19T05:01:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisal\_Thiwanka](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@Nisal\_Thiwanka](https://discuss.elastic.co/u/Nisal_Thiwanka)\
**Post date:** [May 19, 2017, 5:01am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/1 "2017-05-19T05:01:48Z")

</div>

I need to configure filebeat to read log files from several locations and send them to logstash on user request. How can I do that?

---

<div class="post-metadata">

**Author:** ![tharu85](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tharu85](https://discuss.elastic.co/u/tharu85)\
**Post date:** [May 19, 2017, 5:31am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/2 "2017-05-19T05:31:06Z")

</div>

What do you mean by user request. Do you want to send logs to logstash in specific time ?

---

<div class="post-metadata">

**Author:** ![jovanmal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jovanmal/32/17330_2.png) [@jovanmal](https://discuss.elastic.co/u/jovanmal)\
**Post date:** [May 19, 2017, 5:57am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/3 "2017-05-19T05:57:51Z")

</div>

It is no problem to send filebeat log data in specific interval, but I am not sure that is possible to send logs on user's request. I believe it is possible, but have to deal with making scripts for that purpose.

It is possible to configure reading multiple paths on following way, for example (in file filebeat.yml):

```auto
filebeat.prospectors:

- input_type: log
  paths:
    - /var/log/httpd/access_log.log

- input_type: log
  paths:
    - /var/log/httpd/error_log.log

```

Yml syntax requires strong text positioning in this file so as it is, without additional spaces

---

<div class="post-metadata">

**Author:** ![Nisal\_Thiwanka](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@Nisal\_Thiwanka](https://discuss.elastic.co/u/Nisal_Thiwanka)\
**Post date:** [May 19, 2017, 9:13am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/4 "2017-05-19T09:13:22Z")

</div>

Is there a way to send the path as a parameter to the the filebeat.yml configuration file?

---

<div class="post-metadata">

**Author:** ![jovanmal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jovanmal/32/17330_2.png) [@jovanmal](https://discuss.elastic.co/u/jovanmal)\
**Post date:** [May 19, 2017, 1:48pm UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/5 "2017-05-19T13:48:44Z")

</div>

You can only configure parameters inside this file, using yml syntax.

I am so sorry, but cannot understand how to "send the path as a parameter to the the filebeat.yml". Please explain what you want.

An official filebeat docummentation says there is no such option

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

---

<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:** [June 6, 2017, 8:27am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/6 "2017-06-06T08:27:46Z")

</div>

See beats config file format docs: [https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format.html](https://www.elastic.co/guide/en/beats/libbeat/current/config-file-format.html)

You can pass/overwrite settings using environment variables or via `-E` flag.

---

<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 4, 2017, 8:28am UTC](https://discuss.elastic.co/t/how-to-configure-filebeat-to-read-data-from-several-paths-using-a-path-varible-in-its-configuration/86355/7 "2017-07-04T08:28:07Z")

</div>

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