# Metricbeat logging rotateonstartup not work

**URL:** <https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [October 26, 2024, 5:23pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478 "2024-10-26T17:23:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaotiger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xiaotiger/32/138747_2.png) [@xiaotiger](https://discuss.elastic.co/u/xiaotiger)\
**Post date:** [October 26, 2024, 5:23pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478/1 "2024-10-26T17:23:36Z")

</div>

metricbeat.yml  
logging.files:  
interval: 24h  
permissions: 0644  
rotateonstartup: False  
metricbeat version:8.15

According to the above Settings, when metricbeat restarts, why does a new log file (metricbeat-yyyMMdd-1.ndjson) be generated? I want to generate a log file in the form of metricbeat-yyyMMdd.ndjson every day  
example:  
metricbeat-20241025.ndjson  
metricbeat-20241026.ndjson  
metricbeat-20241027.ndjson  
Thank you very much for that answer.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 26, 2024, 5:48pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478/2 "2024-10-26T17:48:27Z")

</div>

From #Community Ecosystem to #Beats

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 26, 2024, 5:48pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478/3 "2024-10-26T17:48:39Z")

</div>

Added #metricbeat

---

<div class="post-metadata">

**Author:** ![xiaotiger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xiaotiger/32/138747_2.png) [@xiaotiger](https://discuss.elastic.co/u/xiaotiger)\
**Post date:** [October 27, 2024, 4:29pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478/5 "2024-10-27T16:29:58Z")

</div>

Thank you for your answers.  
metribeat.version: 8.15  
logging.files.interval: 1d  
test result:  
Exiting: error initializing logging: time: unknown unit "d" in duration "1d" accessing 'logging.files.interval' (source:'/etc/metricbeat/metricbeat.yml')

metricbeat start failed.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 27, 2024, 7:29pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478/6 "2024-10-27T19:29:15Z")

</div>

@xiaotiger Welcome to the community...

HMMMM I am seeing the same behavior...

```auto
logging.to_files: true
logging.files.interval: 24h
logging.files.permissions: 0644
logging.files.rotateonstartup: false << Make sure lowercase f
logging.event_data.files.rotateonstartup: false

```

Hmmm I am seeing the same

Start / stop `metricbeat` 3 times...

```auto
hyperion:logs sbrown$ ls -lrt
total 12
-rw-r--r-- 1 sbrown staff 649 Oct 27 12:26 metricbeat-20241027.ndjson
-rw-r--r-- 1 sbrown staff 6039 Oct 27 12:26 metricbeat-20241027-1.ndjson
hyperion:logs sbrown$ ls -lrt
total 24
-rw-r--r-- 1 sbrown staff 649 Oct 27 12:26 metricbeat-20241027.ndjson
-rw-r--r-- 1 sbrown staff 10366 Oct 27 12:26 metricbeat-20241027-1.ndjson
-rw-r--r-- 1 sbrown staff 7101 Oct 27 12:26 metricbeat-20241027-2.ndjson
hyperion:logs sbrown$ ls -lrt
total 40
-rw-r--r-- 1 sbrown staff 649 Oct 27 12:26 metricbeat-20241027.ndjson
-rw-r--r-- 1 sbrown staff 10366 Oct 27 12:26 metricbeat-20241027-1.ndjson
-rw-r--r-- 1 sbrown staff 11018 Oct 27 12:26 metricbeat-20241027-2.ndjson
-rw-r--r-- 1 sbrown staff 10363 Oct 27 12:26 metricbeat-20241027-3.ndjson

```

@andrewkroh ^^^ Possible Bug? or am I missing something...

---

<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 24, 2024, 7:29pm UTC](https://discuss.elastic.co/t/metricbeat-logging-rotateonstartup-not-work/369478/7 "2024-11-24T19:29:55Z")

</div>

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