Sunday, January 6, 2019

tail + grep (multiple patterns)

https://stackoverflow.com/questions/23395665/tail-f-grep
https://unix.stackexchange.com/questions/37313/how-do-i-grep-for-multiple-patterns-with-pattern-having-a-pipe-character
https://stackoverflow.com/questions/7161821/how-to-grep-a-continuous-stream/7162898#7162898

Example: To grep for "Processing by" & "Parameters:" -
tail -f log/development.log | grep -E "Processing by|Parameters:"

Output:
2019-01-06 14:24:20.030 [INFO ] [30600:1788] Processing by Spree::ProductsController#index as JS

2019-01-06 14:24:20.031 [INFO ] [30600:1788]   Parameters: {"sort_scope"=>"default", "page"=>"12", "infiniteScroll"=>"true"}

No comments:

Post a Comment

Followers

Blog Archive