# Logstash set log rotate time

**URL:** <https://discuss.elastic.co/t/logstash-set-log-rotate-time/74965>\
**Category:** Logstash\
**Created:** [February 14, 2017, 6:01am UTC](https://discuss.elastic.co/t/logstash-set-log-rotate-time/74965 "2017-02-14T06:01:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![howie\_chen](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@howie\_chen](https://discuss.elastic.co/u/howie_chen)\
**Post date:** [February 14, 2017, 6:01am UTC](https://discuss.elastic.co/t/logstash-set-log-rotate-time/74965/1 "2017-02-14T06:01:13Z")

</div>

I have installed logstash-5.2.0 on centos 7.2, the config show as below, now the new log web\_%{+YYYY-MM-dd}.log generated at 8:00 am everyday, but i want to set the log rotate time at 00:00:00 everyday, i can't find logstash logrotate config under /etc/logrotate.d/. How can i set the log rotate time?

input {  
beats {  
port =\> 5044  
}  
}

output {  
if [type] == "web" {  
file {  
path =\> "/data/logs/web\_%{+YYYY-MM-dd}.log"  
codec =\> line { format =\> "%{message}"}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 14, 2017, 6:42am UTC](https://discuss.elastic.co/t/logstash-set-log-rotate-time/74965/2 "2017-02-14T06:42:45Z")

</div>

`%{+YYYY-MM-dd}` expands the timestamp found in the `@timetamp` field, which is UTC. This is not configurable.

---

<div class="post-metadata">

**Author:** ![howie\_chen](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@howie\_chen](https://discuss.elastic.co/u/howie_chen)\
**Post date:** [February 14, 2017, 7:01am UTC](https://discuss.elastic.co/t/logstash-set-log-rotate-time/74965/3 "2017-02-14T07:01:57Z")

</div>

Got it, Thanks for your reply.

---

<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:** [March 14, 2017, 7:02am UTC](https://discuss.elastic.co/t/logstash-set-log-rotate-time/74965/4 "2017-03-14T07:02:13Z")

</div>

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