Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3851084
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:06:30+00:00 2026-05-19T17:06:30+00:00

I have a file test.log. Very big log file. It has different levels of

  • 0

I have a file test.log. Very big log file. It has different levels of logging. For eg, trace, debug, info, warning and error.

Obviously trace level messages are just spamming at high speeds. I wanted to see all the messages without trace level logs.

So I did this:

cat test.log | grep -v "trace"

Works good.

Now I want to filter the remaining messages based on a certain keyword keyword1.

So I did this:

cat test.log | grep -v "trace" | grep "keyword1"

Works good.

Now I want to get that same output on a continual basis, I thought of replacing cat with tail -f.

tail -f test.log | grep -v "trace" | grep "keyword1"

But this does not work. I get no output at all.

What am I doing wrong? And how can I get my desired filtered ‘tail & follow’ output.

Thanks for the help.

(btw, I am using cygwin… if that matters in any way)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:06:30+00:00Added an answer on May 19, 2026 at 5:06 pm

    You are encountering buffering issues: for performance reasons grep will keep quite a bit of output in its buffer and will output the whole chunk in one go. That means that when a line is read from the input, grep will send it to stdout once it has read (and let through) even more lines – which can be quite some time later when dealing with a log file that is being read-in using tail -f.

    Many grep variants have a switch to turn-on line-buffered mode, which will output each line on its own – with some performance loss. For example GNU grep has a --line-buffered option to achieve this effect.

    Just add that option (or the appropriate one for your version of grep) to all your grep invocations and you see some output as soon as a matching like is added to the log file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test file that has many lines, each line looks something like:
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
I have a PHP file, Test.php, and it has two functions: <?php echo displayInfo();
I have this code below: my $file = 'c:\test.log'; open (FILE, "<", $file) or
i have some file test.php <?PHP $config_key_security = test; ?> and i have some
Let's say I have a file called test.txt within the package com.test.io within my
I have a test file that contains tests taking quite a lot of time
I have a test file that contains 1,2,3 2,3,4 5,6,7 I want to insert
For simplicity, i have the following file named test.jsp: <script language=javascript> alert(a$b.replace(/\$/g,k)); </script> I
For example, suppose I have a batch file called 'test.cmd' and it simply contains:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.