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

Ordering of matched files being watched #56

Closed
dev-head opened this issue Jun 23, 2015 · 5 comments
Closed

Ordering of matched files being watched #56

dev-head opened this issue Jun 23, 2015 · 5 comments

Comments

@dev-head
Copy link

The Request:

This is more of an enhancement request to add support for the matched files to be watched in the order of their timestamp oldest to newest and or add an option to define the some ordering behaviors.

The problem

Given: path => "/tmp/file.*.json"

Right now the ordering of watched files appear to be based on whatever order glob returns. This leads to situations where a newer file ends up being watched before an older one.

In my case I need logstash to respect this historical order of the matched files, otherwise it leads to the old data being considered the latest version. (i get around this by aggressively pruning old files that i "think" are done and when I run into this issue I end up having to reload the latest data manually).


Is anyone else running into this?

@jordansissel
Copy link
Contributor

I can confirm that the order of each file being visited is not defined.

As a workaround, can you try generating or templating your logstash config based on the file list first?

Something like
ls -t /tmp/file.*.json will give you the list of files ordered by modification date, if that helps.

@splashx
Copy link

splashx commented Oct 5, 2015

@PhaedrusTheGreek
Copy link

From @guyboertje 's blog post, this is a desired future capability:

Support for prioritising the order of the files that are activated. Choose between oldest, newest, biggest, smallest, most read, etc.

@guyboertje
Copy link
Contributor

I suspect the OP was not doing file tailing but file read.

@guyboertje
Copy link
Contributor

This is now supported.

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