# How to divert the logstash logs?

**URL:** <https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922>\
**Category:** Logstash\
**Created:** [April 2, 2017, 2:17pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922 "2017-04-02T14:17:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [April 2, 2017, 2:17pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/1 "2017-04-02T14:17:13Z")

</div>

I am getting my LogStash logs to /var/log/logstash while I want to send them to /log/logstash.

I saw many places writing how to do so but still I am a little confused.

From now I am guessing I have to change the log4j configuration file in the following lines:

![](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a9e6a88b07b9ef692167b484751067886749053c.png)

Also to change this in /etc/logstash/logstash.yml (this I did change and all what it did it stopped writing logs to /var/log/logstash but did not write logs to any where):

![](https://us1.discourse-cdn.com/elastic/original/3X/d/c/dc2569910089a421db01d17aa723c8f712f4c8c4.png)

how to change these and is there a different way?

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 3, 2017, 11:25pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/2 "2017-04-03T23:25:59Z")

</div>

You updated the wrong variable in logstash.yml.

it is "path.logs" that you need to change and not path.data

---

<div class="post-metadata">

**Author:** ![Sujith](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@Sujith](https://discuss.elastic.co/u/Sujith)\
**Post date:** [April 4, 2017, 12:57pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/3 "2017-04-04T12:57:12Z")

</div>

Hi Jkuang,

Even im facing same problem as tomer, where even after giving the below path in logstash yml file  
path.logs: D:\ELK-Stack\logstash-5.2.0\logs\logstash.log

Still logs are not generating in logstash, im using windows os, so please let us know how do we get logs from logstash

---

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [April 4, 2017, 12:58pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/4 "2017-04-04T12:58:51Z")

</div>

Thanks jkuang, you are right I took the wrong picture.

I fixed my problem, I didnt have permission to write to the directory. changed it with chmod.

I guess this is not you problem @Sujith since you are using windows

---

<div class="post-metadata">

**Author:** ![Sujith](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@Sujith](https://discuss.elastic.co/u/Sujith)\
**Post date:** [April 4, 2017, 1:04pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/5 "2017-04-04T13:04:35Z")

</div>

Tomer, may i know what shall be done to get logstash logs as im not able to fine logs at al for logstash

---

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [April 4, 2017, 1:09pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/6 "2017-04-04T13:09:57Z")

</div>

Wish I couldve help you! I just know linux systems for logstash.

In linux it sends when not configured to /var/log/logstash. if you configure to where it should be sent in logstash.yml in path.log it should get there if that file has permettion to write inside it. I dont think this will help for Windows.

I recommend to open a new question in discuss since I believe windows will be different.

---

<div class="post-metadata">

**Author:** ![Sujith](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@Sujith](https://discuss.elastic.co/u/Sujith)\
**Post date:** [April 4, 2017, 1:12pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/7 "2017-04-04T13:12:49Z")

</div>

i completely understand, No problem.

Thank you tomer.

---

<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 2, 2017, 1:12pm UTC](https://discuss.elastic.co/t/how-to-divert-the-logstash-logs/80922/8 "2017-05-02T13:12:50Z")

</div>

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