Closed amanbhaskar92 closed 1 year ago
Are you able to upgrade to the latest version of Vector and let us know if the problem still persists?
You could also try https://vector.dev/docs/reference/configuration/sources/file/#read_from to have Vector read from the latest rather than start from the beginning.
@jszwedko I am already using read _from: end. @dsmith3197 Can you please suggest the docker image with the latest version ? Can I use latest-alpine?
@dsmith3197 I am now using the latest-alpine image with version as version="0.32.1" arch="x86_64" revision="9965884 2023-08-21 14:52:38.330227446", is this version fine?
Yep, 0.32.1 is the latest version.
Thanks , I have updated the version last night and things are looking good for now. I have major production rollout in coming days so I would request you to keep this bug open for few more days so that I can put my findings here and take your valuable advice.
One more thing I noticed is that vector is keeping handle open for log rotated files 1 /usr/local/bin/vector 544 /shared/applogs/oms-agt-batch1-agt-glb-grp-2-bfc4b9d8f-dlfg9/oms-agt-batch1-agt-glb-grp-2-bfc4b9d8f-dlfg9.log (deleted) 1 /usr/local/bin/vector 547 /shared/applogs/oms-agt-batch1-agt-glb-exec-collection-576bb44f45-w97ld/oms-agt-batch1-agt-glb-exec-collection-576bb44f45-w97ld.log (deleted) 1 /usr/local/bin/vector 549 /shared/applogs/oms-agt-batch1-agt-glb-exec-collection-576bb44f45-w97ld/oms-agt-batch1-agt-glb-exec-collection-576bb44f45-w97ld.log (deleted)
Will it make any impact ? Will it read from deleted file?
I can confirm it is reading from deleted(log rotated files), Is the bug , How can I can fix this behavior. It should not read from the rotated files. I am already using checksum strategy n ignore_older_secs: 600
/shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 533 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 546 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 554 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 558 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 562 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 564 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log (deleted) 1 /usr/local/bin/vector 566 /shared/applogs/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb/oms-agt-batch1-agt-glb-grp-3-7c954df77d-ztcmb.log
@jszwedko @dsmith3197 Can you please suggest here , how to get rid of file descriptors of rotated files ?
@jszwedko @dsmith3197 Can you please suggest here , how to get rid of file descriptors of rotated files ?
Currently there isn't a mechanism to have Vector ignore rotated files. It will continue trying to read them until it hits the end of the file.
Related: https://github.com/vectordotdev/vector/issues/18864
We have an issue open to track the feature request for adding support for config option to not read to EOF: https://github.com/vectordotdev/vector/issues/18863
Closing this issue in lieu of that one.
A note for the community
Problem
Usecase: My java application is deployed on kubernetes. It has many instance as pods running. Each pod writes the logs to shared mounted volume. Under shared volume , folder gets created with pod name and under this folder , there are log files /shared/applogs/podname/files. Also log rotation is on. I am trying to read only files ending with .log using vector and send the events to kafka.
Configuration
Version
version="0.27.0" arch="x86_64" revision="5623d1e 2023-01-18"
Debug Output
No response
Example Data
No response
Additional Context
No response
References
No response