# Create folder to save logs from Filebeat

**URL:** <https://discuss.elastic.co/t/create-folder-to-save-logs-from-filebeat/175535>\
**Category:** Logstash\
**Tags:** fleet\
**Created:** [April 5, 2019, 7:39am UTC](https://discuss.elastic.co/t/create-folder-to-save-logs-from-filebeat/175535 "2019-04-05T07:39:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donny\_Nightfrost](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/donny_nightfrost/32/43536_2.png) [@Donny\_Nightfrost](https://discuss.elastic.co/u/Donny_Nightfrost)\
**Post date:** [April 5, 2019, 7:39am UTC](https://discuss.elastic.co/t/create-folder-to-save-logs-from-filebeat/175535/1 "2019-04-05T07:39:34Z")

</div>

Greetings, I have a simulation I wanted to try :

- Filebeat (one agent or more) send logs to another machine (where Logstash located)
- Logstash to receive the logs and do the filters
- Logs will be saved on specified directory, e.g : /var/log/syslog

My question: Is it possible to make a directory for each agents / clients right after Logstash received the logs from FIlebeat so that the logs will be separated by host name? Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 5, 2019, 12:32pm UTC](https://discuss.elastic.co/t/create-folder-to-save-logs-from-filebeat/175535/2 "2019-04-05T12:32:18Z")

</div>

Filebeat includes the hostname in the events. You can use a [sprintf](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html) reference in the output to refer to that hostname.

---

<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:** [May 3, 2019, 12:32pm UTC](https://discuss.elastic.co/t/create-folder-to-save-logs-from-filebeat/175535/3 "2019-05-03T12:32:19Z")

</div>

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