Sponsored Content
Full Discussion: grep for last 15 min of log
Top Forums Shell Programming and Scripting grep for last 15 min of log Post 302399822 by shehzad_m on Monday 1st of March 2010 05:16:32 PM
Old 03-01-2010
Quote:
Originally Posted by joeyg
Can you show what a tail command provides? That way someone can see the data format and help if any "tricks" with your request.
In other words, cut & paste the last 10-20 rows of the file into a follow-up message. Please remember to use code-tags around your pasted test to help with readability.
example

Code:
Mar  1 08:54:17 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 08:55:20 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 08:56:23 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 08:57:26 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 08:58:29 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 08:59:32 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:00:35 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:01:38 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:02:41 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:03:44 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:04:47 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:05:50 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:06:53 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:07:56 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:08:59 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:10:02 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:11:05 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host
Mar  1 09:12:08 houston1 Synergy 1.3.1: WARNING: synergyc.cpp,265: failed to connect to server: No route to host

so i wanna grep the error synergyc.cpp,265 only from the last 15 of the log.

Last edited by Scott; 03-01-2010 at 06:54 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Best approach for a 10 min extract out of several log files with timestamped records

I have a task where I need to code a shell script to extract a 10 min range (10 min from now until now) extract of a log file. I taught I could simply use a command that would say something like Start=date - 10 min but I didn't find anything. Looks like the only solution would have to code a... (3 Replies)
Discussion started by: Browser_ice
3 Replies

2. Shell Programming and Scripting

crontab in every 05,20,35,50 min

Hi , How can i set a cronjob which needs to run every 05,20,35,50 min . I tried 05,20,35,50 * * * * /exec/eerrtis/tttttk/AOOK00000/bin/Packing.sh.. but its giving error while saving the crontab file .... What is the correct way ??? Thanks and Regards (4 Replies)
Discussion started by: scorpio
4 Replies

3. Shell Programming and Scripting

Find a min,group by.

I have a data file with records: A123|Peter|20 A123|Jack |10 B222|Helen|15 B222|Jane |13 B222|Guy |30 I want for find the min for $3 group by $1. i.e A123|Jack|10 B222|Jane|13 Thanks. (4 Replies)
Discussion started by: Shivdatta
4 Replies

4. Shell Programming and Scripting

How to get the counter value incremented after every 1 min?

I want to check the counter value for every 1 min until the particular counter value is reached and it should exit. Counter value: 15.( For Example) counter = 1 The start time is noted using Localtime. How can i do this in perl? Regards Archana (1 Reply)
Discussion started by: vanitham
1 Replies

5. Shell Programming and Scripting

Get min from a column conditionally

hi, i have a file with folowing content: STORAGE PERCENTAGE FLAG: /storage_01 64% 0 /storage_02 17% 1 /storage_03 10% 0 /storage_04 50% 1 I need to get the value of STORAGE from those with FLAG=0 and which has the min PERCENTAGE i am able to get the STORAGE corresponding to... (8 Replies)
Discussion started by: kichu
8 Replies

6. Shell Programming and Scripting

script use min resource ( grep grep)

Hi i wrote script use it as watchdog ( i mean it check another program (pooya) whenever that was killed (closed or crashed) it run another script (pooya_start.sh) to start it, this script work fine and do the job for me , i need help of an expert to tell me (exact command) how to change this... (8 Replies)
Discussion started by: pooyair
8 Replies

7. Shell Programming and Scripting

grep log lines logged in 10 min

A log files has lines (1 line per each log for a majority; a few for 2 lines per each log) May 31 14:00:11 rtprodapp1 local2:notice sudo: jdoe : TTY=pts/0 ; PWD=/home/jdoe ; USER=root ; COMMAND=/usr/bin/su - May 31 14:03:19 rtprodapp1 local2:notice sudo: jdoe : TTY=pts/0 ; PWD=/home/jdoe ;... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

8. AIX

crontab every 5 min.

Hi running aix 6.1 oslevel 6100-07-03-1207 I need to confirm that this cron entry is set properly. I need it set for every 5 min. 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script.sh it does not appear that it is running every 5 min but it did in the beginning. (4 Replies)
Discussion started by: vpundit
4 Replies

9. UNIX for Dummies Questions & Answers

Cron every 5 min

Hi, I am trying to run a script in cron every 5 min in SOLARIS 10 When I do5 * * * * /path to fileor*/5 * * * * /path to file Doesn't work. Please let me know what should I put in the cron entry Thanks (2 Replies)
Discussion started by: Rossdba
2 Replies

10. Shell Programming and Scripting

Find min and max time taken from a log file

You have a log file as attached in sample input with various operations and time taken by each of them. Write a script to find the min and max time taken for each operation. Sample output is attached. Sample Input is given as below: operation1,83621 operation2,72321 operation3,13288... (1 Reply)
Discussion started by: Chandan_Bose
1 Replies
DUMP_SOCKDFR(8) 					      System Manager's Manual						   DUMP_SOCKDFR(8)

NAME
dump_sockdfr - Display contents of frozen route file for SOCKS server SYNOPSIS
dump_sockdfr [infile] DESCRIPTION
dump_sockdfr reads in a frozen route file for the SOCKS server and produces a listing of its contents on the standard output. The argument is optional; if omitted, /etc/sockd.fr is assumed. The frozen route file is produced by make_sockdfr and is essentially the memory image of the parsed route file. Using the frozen route file can reduce the start-up delay of the SOCKS server program since it no longer has to parse the file contents. When the SOCKS server starts, it always looks for the frozen route file /etc/sockd.fr first. If that file is not found, it then tries to use the plain-text route file /etc/sockd.route. If you use frozen route file, you must remember to run make_sockdfr every time after you modify the plain-text file or the SOCKS server will continue to use the frozen version of a previous route file. FILES
/etc/sockd.fr, /etc/sockd.route SEE ALSO
make_sockdfr(8), sockd.fr(5), sockd.route(5) AUTHOR
Ying-Da Lee, yingda@esd.sgi.com or yingda@best.com May 6, 1996 DUMP_SOCKDFR(8)
All times are GMT -4. The time now is 11:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy