Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am dumping some debug info into a text file that I am using tail -f to monitor.

Is there a tool that I can then pipe that tail -f data into to be able to search the text on screen using regular expression commands like search in vim.

share|improve this question
    
see if the answers in unix.stackexchange.com/questions/25211/… can do what you want. the OP there wanted it to alert, but there's an example using regexes to match and beep. you could use the same regex matching, and have your own action. –  Tim Kennedy Jul 27 '13 at 5:57
    
not quite I want to be able to explore the data not highlight something specific. I have all this async stuff flying around so other then searching through the output its a shot in the dark to find what I want. –  James Andino Jul 27 '13 at 6:03
add comment

2 Answers

If you can't find anything else, you could try seetxt, which can monitor and update a loaded file at configurable intervals (1 second granularity), and has PCRE searching.

Unfortunately it does too many other things as well; I wrote it about 5 years ago and it was my first "big" C project; the source is pretty ugly, lol, but it generally works with some caveats that shouldn't affect what you are doing unless the input is very large or contains a lot of odd characters.

That said, it's something I'd think about revamping for exactly this purpose if it's a niche that lacks. I generally just stop/start things and deal with static logs when debugging, but something that streamed input and did regexps is a good idea.

share|improve this answer
add comment

Use less. Start less on the text file you want to monitor:

less some_file

If you want to search for a pattern, ues a slash to start a search a pattern:

/<pattern>  # forward search
?<pattern>  # backward search

If you want to filter the output use an ampersand:

&<pattern>

Then start the continuous output using shiftf. You can exit the continuous output display with ctrlc and refine or cancel your filter pattern or start a search.

share|improve this answer
    
This does not work if the file is truncated = / any advice on getting around this? –  James Andino Jul 27 '13 at 21:28
1  
@JamesAndino Type :e Enter to reload the file if it has changed. –  Gilles Jul 27 '13 at 22:25
    
word im just being crazy ocd about my tools again aint i –  James Andino Jul 28 '13 at 2:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.