Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Auto splitting for file output plugin #1550

Closed
Jamesits opened this issue Jul 27, 2016 · 6 comments
Closed

[Feature Request] Auto splitting for file output plugin #1550

Jamesits opened this issue Jul 27, 2016 · 6 comments

Comments

@Jamesits
Copy link

For output.file plugin, cut (rename, logrotate) the file after reaching a certain size.

@flexd
Copy link
Contributor

flexd commented Jul 28, 2016

I just started/finished writing one of these that rotates the file based on file age. It could easily be modified to support size as well. If I have time I will publish it soon.

@praveenuchiha
Copy link

Any update on this? logrotate would be handy for file output based on size and age.

@danielnelson
Copy link
Contributor

As a workaround, you could use logrotate or another log rotation service to implement this. You can use the telegraf logrotate file as an example.

@flexd
Copy link
Contributor

flexd commented Oct 19, 2017

I never got around to using what I wrote, and I'm not sure where I put it, unfortunately. It should be in a git repo somewhere 😄

@flexd
Copy link
Contributor

flexd commented Oct 20, 2017

I can't find it now, must be on a old machine somewhere, it was never pushed to GitHub.

I started with the normal file plugin https://github.com/influxdata/telegraf/tree/master/plugins/outputs/file and just added closing the current file and opening a new one every X minutes if data was sent.

You can rotate a file by using a custom writer, something like suggested here https://stackoverflow.com/a/28797984

@darinfisher
Copy link
Contributor

closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants