Any better way to extract the last 10 minutes from logfile?
Attempt 1: Too slow if the the log file contains over 10000 lines.
Moderator's Comments:
Please use CODE tags. We know that you know how to use CODE tags because you've used them before. But, several of your posts have been edited by moderators to add tags; and several more of your posts should have had tags but nobody bothered to fix them.
---------- Post updated at 06:30 PM ---------- Previous update was at 02:12 PM ----------
Python method is quite fast but only works if the log contains only dates, any suggestion on how to fix this?
Last edited by timmywong; 12-26-2013 at 06:34 AM..
Reason: Add CODE tags.
Hi ,
Can someone help me,I am not well versed with scripting,it is very urjent.
Need a script in perl or shell for the following task.
The logfile contains several entries of which one particular string to be searched and that complete line has to be removed and copied to another file to... (25 Replies)
OK, I am by no means a programmer...
I have been given the task to do some automation scripts. I have got most of it working from snippets I have found on the Web.
One requirement has me stumped.
The initial timing file created by the user is a comma delimited in the following format.... (4 Replies)
I would like to create a script that will send an email to me if it does not update after 5 minutes.
I have created this script but it doesn't work.
#!/bin/ksh
# Variable Declaration
log=/opt/app/netcool/omnibus/log.txt
servertime=`date | awk '{print $2,$3,$4 }' | cut -d ":" -f1,2`... (5 Replies)
Bonjour,
I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things.
The script use the following technique :
tail -fn0 $logfile | \
while read line ; do
... some stuff
done
First one, I'd like a way to end the monitoring script if a... (3 Replies)
I want to extract the logs between the current time stamp and 15 minutes before and sent an email to the people configured. I developed the below script but it's not working properly; can someone help me?? I have a log file containing this pattern:
Constructor QuartzJob
... (3 Replies)
Hi, please help with below time conversion to minutes.
one column values:
2 minutes 16 seconds 420 msec
43 seconds 750 msec
0 days 3 hours 29 minutes 58 seconds 480 msec
11 seconds 150 msec
I need output in minutes(total elapsed time in minutes) (2 Replies)
Hi all,
System Ubuntu 16.04.3 LTS
i have the following log
INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042
INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)