LINUX Filter Log by Keyword

Friday, December 8th, 2023 | System

To modify the command tail -F -n 100 access.log to filter based on a keyword, you can use a pipe (|) to pass the output of tail to grep, which is a command-line utility for searching plain-text data for lines that match a regular expression. Here's how you do it:

tail -F -n 100 access.log | grep "your_keyword"

Replace "your_keyword" with the specific word or pattern you're looking for. This command will continuously follow the access.log file (due to -F) and display the last 100 lines (due to -n 100), but only those lines that contain your specified keyword will be shown.


Comments


E19 Creative

Products | Support | About | Contact | Login