Skip to main content

Hi all, I’ve been using an app called “ripgrep” for a while now and wanted to share it with the community. 

https://github.com/BurntSushi/ripgrep

“ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.”

ripgrep is written in Rust which is “blazingly fast” for this type of operation. I found this article very interesting on the subject of benchmarking 

https://blog.burntsushi.net/ripgrep/

Finding the specific file or files where something occurred can be tricky, but ripgrep makes it easy with a simple regex pattern.

rg "^.*?\b13.02.2023\b.*?\bError\b.*?$"

It provides each instance that matches the expression under the file's name. 

It also allows you to use flags to alter the output; the most useful I’ve found are the -A, -B and -C flags. 

-A Provides a number of lines before the match

-B Provides a number of lines after the match

-C Provide a number of lines before and after the match

Many other flags can be used, including a flag that recursively looks through zipped folders (unsurprisingly, that is the -z flag)

You can also show the files where the match occurred with the -l flag, which helps you hone in on the specific file you need to find.

 

I hope it helps someone!

Ed

This looks like a very interesting tool for sure and as in your example can help crawl the Veeam logs. Looking forward to testing this out.  Thanks for sharing. 👍


Thanks for the suggestion.  I don’t have a lot of linux in place, but this is a cool looking suggestion if I do get some more.


@dloseke it works on Windows too. The above example was running on the VBR server.


Thanks for the suggestion.  I don’t have a lot of linux in place, but this is a cool looking suggestion if I do get some more.

I used Chocolatey to install it on windows and it does work as noted.


Oh geez...don’t know how I didn’t notice it was on Windows...I saw grep and thought linux I guess….


Hmm..interesting @EdxH . I’ll try & check it out. Thank you for the post!


Comment