You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a dangerous configuration because the Agent will watch each of the files that match the regex (all of them, in this case). After each file is modified, the agent will become confused and jump to that file to start taking in log events. It will never follow all of the files at once, instead it follows only one file at a time.
The solution
I don't have a real solution here.. but ideally what we want is to be able to tell the agent that there is a whole directory of files ... follow them all, and keep track of all of their inodes. If any file is rotated, thats fine .. jsut keep following it by inode. If a new file is created, then start reading that file as well.
I know that this can lead to resource problems if you are writing out a lot of log files, but I believe that complexity and concern is up to the end-user to decide upon implementation.
The text was updated successfully, but these errors were encountered:
We can probably have a higher level configuration that could match all flows in a directory. For example "/mnt/log/${flow}.log." could create flows tailing /mnt/log/kern.log. and /mnt/log/syslog.log.*
To save the resource (for not tracking too many files) we could have another option of "ignoreOlder" which ignores to track a file flow older than a particular period in case too many files get added to the directory without rotation and deletion.
The problem
We found this out the fun way ... Lets imagine you have a fairly normal
syslog-ng
config like this:This creates a log directory like this:
Now imagine you want to tail all of these files and send all the data into Kinesis. This makes sense, right?
Wrong.
This is a dangerous configuration because the Agent will watch each of the files that match the regex (all of them, in this case). After each file is modified, the agent will become confused and jump to that file to start taking in log events. It will never follow all of the files at once, instead it follows only one file at a time.
The solution
I don't have a real solution here.. but ideally what we want is to be able to tell the agent that there is a whole directory of files ... follow them all, and keep track of all of their inodes. If any file is rotated, thats fine .. jsut keep following it by inode. If a new file is created, then start reading that file as well.
I know that this can lead to resource problems if you are writing out a lot of log files, but I believe that complexity and concern is up to the end-user to decide upon implementation.
The text was updated successfully, but these errors were encountered: