Filetrack
Filetrack is a library for persistent reading of logs similar to the mechanisms used in Filebeat and other software alike. It provides a few useful primitives for working with IO and its main intention is to be used for implementation of custom log processors.
Multireaderthat lets you work with a list of readers as if you had one single buffer
# use ;
# use Multireader;
let inner_items = vec!;
// we get result here because Multireader performs seek
// (fallible operation) under the hood to determine sizes
let mut reader = new?;
# let mut buf = vec!;
reader.read_to_end?;
assert_eq!;
# Ok::
InodeAwareReaderthat allows working with rotated logs and maintating persistent offset inside them. Scheme of persistence is to be implemented by user.
# use ;
# use ;
#
#
let mut reader = from_rotated_logs?;
reader.seek_persistent?;
# let mut buf = vec!;
reader.read_exact?;
save_state?;
# Ok::
TrackedReaderthat allows to read logs or any other content from rotated files with offset persisted across restarts inside a file in case you want a ready-to-use structure.
// running this program multiple times will output next line on each execution
# use BufRead;
# use ;
let mut reader = new?;
# let mut input = Stringnew;
match reader.read_line? ;
# Ok::
See documentation for examples and working principles.