# Question about log rotation and log order

**URL:** <https://discuss.elastic.co/t/question-about-log-rotation-and-log-order/255427>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 15, 2020, 7:21am UTC](https://discuss.elastic.co/t/question-about-log-rotation-and-log-order/255427 "2020-11-15T07:21:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guohao\_Yi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guohao_yi/32/79015_2.png) [@Guohao\_Yi](https://discuss.elastic.co/u/Guohao_Yi)\
**Post date:** [November 15, 2020, 7:21am UTC](https://discuss.elastic.co/t/question-about-log-rotation-and-log-order/255427/1 "2020-11-15T07:21:13Z")

</div>

I have learned that filebeat can be configured properly to handle log rotation correctly. However, I am not sure if the following situation I am going to mention is possibile to configure or not.  
We want to collect logs(which has rotation) from k8s pods and send them to a cloud file server. The cloud server is an NFS system in which we want all the logs of each pod in the cluster is properly collected with preserver log order.

1. I want to have a custom ouput which is able to preserve log order even when log rotation occur (i.e filebeat can somehow detect log roation and inform me with the rotation event so that I can do a rotation on the NFS system before the new log file is created)
2. Each line of log should preserved their order when delivered to the custom output  
Is it possibile to have a custom output like that?

---

<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:** [December 13, 2020, 9:21am UTC](https://discuss.elastic.co/t/question-about-log-rotation-and-log-order/255427/2 "2020-12-13T09:21:16Z")

</div>

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