WIP: Tail-log filter CL tool, written in Rust.
Assuming you have Rust installed...
- Clone the reopository:
$ git clone https://github.com/jinjagit/tailit.git
- Move into the cloned repository directory:
$ cd tailit
- Create a release build:
$ cargo build --release
- Change to release directory:
$ cd target/release
- Copy the executable to somewhere on your path. For me, this was:
$ sudo cp tailit /bin/tailit
- Ensure you have permissions to execute the file, etc. E.g.
$ sudo chmod 755 tailit
- Change to a directory with a logfile you wish to monitor for changes.
- Run tailit with some suitable search terms for your case. E.g.
$ tailit example_file.log --s3 search_term1 --s7 search_term2
Example of tailing a Rails development.log
file, with
$ tailit development.log --s6 Rendered --s2 Started Completed --s12 Parameters --s11 ::text
Output of $ tailit -h
- Search terms are seperated by spaces in the command arguments, therefore searching for a phrase that contains spaces will not highlight matches of the whole term.
- Different search terms that are found on the same line of a log file will result in the same line being printed more than once, each output highlighting the occurences of one of the search terms in the line.
- Cannot, yet, specify return of n preceding &/or following lines.