My goal is to monitor the response time from the access logs of nginx server. I am using gawk to print the needed fields - 'response time' and 'name of the service' from nginx logs.
So, I have the response time for this particular service. Now, I want to compare the response time with a number (say 1.000 in this case) and get the result only with response time > 1.000 and send an email with the output.
I get this output everytime I run the command. How do I just get the new values in output? The access log file has a date and time stamp for each line.
I am not quite sure how to approach this. Any suggestions?
Thanks Chubler_XL and MadeInGermany for your inputs.
Seemed a little complicated to understand since I am a newbie. Currently, I am using two files and finding the difference of the contents (to find the newly appended records). Have not tested it yet - shall keep you posted once I try it out.