# Filebeat-json.log size and rotation

**URL:** https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773
**Category:** Beats
**Tags:** fleet
**Created:** [September 9, 2021, 12:34pm UTC](https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773 "2021-09-09T12:34:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![greggailly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/greggailly/32/91105_2.png) [@greggailly](https://discuss.elastic.co/u/greggailly)
#### Post date: [September 9, 2021, 12:34pm UTC](https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773/1 "2021-09-09T12:34:43Z")

</div>

We are having size issues with the filebeat-json.log file.  
One of our servers had one 122gb filebeat-json.log, are they not supposed to rotate to prevent this ?  
All of our servers run windows server 2016/2019 and elastic agents are at version 7.14.1.

More interestingly all servers don't seem to behave the same way.  
Some will rotate the files but we can't seem to figure out according to which criteria while other don't rotate at all.

Example 1:

 ![Screenshot 2021-09-09 at 14.20.35](https://us1.discourse-cdn.com/elastic/original/3X/a/5/a5e21487704d96b6f23b6cffd238160b4ad8400c.png)

Example 2:

 ![Screenshot 2021-09-09 at 14.20.54](https://us1.discourse-cdn.com/elastic/original/3X/f/b/fbe426b4b2a2a424cf84549ef92f324ade9ba23f.png)

Thanks for the help !

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [September 10, 2021, 8:47am UTC](https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773/2 "2021-09-10T08:47:56Z")

</div>

The files should rotate. Do you use Elastic Agent standalone or managed mode? Could you share how you start Elastic Agent?

That the log files are not rotated might indicate a permission issue. Are all the Elastic Agents started with the same user on the system? Are the log files in the same directories?

Could you share your elastic-agent log file?

---

<div class="post-metadata">

### Author: ![greggailly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/greggailly/32/91105_2.png) [@greggailly](https://discuss.elastic.co/u/greggailly)
#### Post date: [September 10, 2021, 9:05am UTC](https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773/3 "2021-09-10T09:05:46Z")

</div>

Agent is started in managed mode with the standard install command (with a manual restart due to enrollment issues as mentioned here: [Elastic Agent won't enroll - #12 by greggailly](https://discuss.elastic.co/t/elastic-agent-wont-enroll/282212/12)).  
All agents are started on different servers with different users so user permissions might have an influence.  
Logs are too big to be opened but from what we could see at the start, most of the content is comes from indexing issues (due to grok parsing failure) being logged.  
For now we unchecked "Collect agent logs" from the policy and all servers seem to have the "standard" 10Mb/7 files rotation.  
It looks like this option has an impact on rotation.

Thanks for the help !

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [September 23, 2021, 6:56am UTC](https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773/4 "2021-09-23T06:56:13Z")

</div>

Hi @greggailly We have seen other issues around rotation on windows and are investigating on what is causing this. Here is a related issue I recommend to follow: [https://github.com/elastic/beats/issues/27853](https://github.com/elastic/beats/issues/27853)

---

<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: [October 21, 2021, 8:56am UTC](https://discuss.elastic.co/t/filebeat-json-log-size-and-rotation/283773/5 "2021-10-21T08:56:17Z")

</div>

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