# Filebeat is not writing log to Destination folder

**URL:** https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822
**Category:** Elasticsearch
**Created:** [October 11, 2023, 1:23pm UTC](https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822 "2023-10-11T13:23:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)
#### Post date: [October 11, 2023, 1:23pm UTC](https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822/1 "2023-10-11T13:23:52Z")

</div>

Hi Team,

In my current project I am using filebeat to load csv files to Elasticsearch but filebeat is not writing the log files in to the destination folder instead it is writing /var/log/messages file. Could you please advise why it is happening like this.  
Below is the configuration of filebeat.yml.

```auto
logging.level: debug
files:
  path: /var/log/filebeat
  name: filebeat.log
  keepfiles: 7

```

Thanks,  
Debasis

---

<div class="post-metadata">

### Author: ![iulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iulia/32/124658_2.png) [@iulia](https://discuss.elastic.co/u/iulia)
#### Post date: [October 11, 2023, 5:31pm UTC](https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822/2 "2023-10-11T17:31:58Z")

</div>

Hi!  
Can you try

```auto
logging:
  level: debug  
  to_files: true
  files:
    path: /var/log/filebeat
    name: filebeat.log
    keepfiles: 7

```

---

<div class="post-metadata">

### Author: ![Debasis\_Mallick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/debasis_mallick/32/123723_2.png) [@Debasis\_Mallick](https://discuss.elastic.co/u/Debasis_Mallick)
#### Post date: [October 12, 2023, 6:31am UTC](https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822/3 "2023-10-12T06:31:38Z")

</div>

Thanks @iulia for help. Is there any way we can mention the log file size because after 11MB it is creating one more new file.

Thanks,  
Debasis

---

<div class="post-metadata">

### Author: ![iulia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iulia/32/124658_2.png) [@iulia](https://discuss.elastic.co/u/iulia)
#### Post date: [October 12, 2023, 11:00am UTC](https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822/4 "2023-10-12T11:00:49Z")

</div>

Happy to help!  
You can change the `logging.files.rotateeverybytes` parameter, the default is to create a new file at 10485760 (10 MB). So you can increase this if you want to keep a bigger file before switching.  
See reference to all the parameters here:

> **[Configure logging | Filebeat Reference \[8.10\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-logging.html#_logging_files_rotateeverybytes)**

---

<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 9, 2023, 11:01am UTC](https://discuss.elastic.co/t/filebeat-is-not-writing-log-to-destination-folder/344822/5 "2023-11-09T11:01:32Z")

</div>

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