Sponsored Content
Top Forums Shell Programming and Scripting Take minute per minute from a log awk Post 302626903 by jockx on Friday 20th of April 2012 01:24:31 AM
Old 04-20-2012
Take minute per minute from a log awk

Hi, I've been trying to develop a script that performs the parsing of a log every 1 minute and then generating some statistics. I'm fairly new to programming and this is why I come to ask if I can lend a hand.

this is my log:



Code:
xxxx 16/04/2012 17:00:52 - xxxx714 - E234 - Time=       119 ms. 
xxxx 16/04/2012 17:00:52 - xxxx716 - A234 - Time=       144 ms. 
xxxx 16/04/2012 17:00:52 - xxxx731 - A323 - Time=        80 ms. 
xxxx 16/04/2012 17:00:52 - xxxx733 - A234 - Time=        90 ms. 
xxxx 16/04/2012 17:00:53 - xxxx735 - A234 - Time=        91 ms. 
xxxx 16/04/2012 17:00:53 - xxxx736 - A234 - Time=        89 ms. 
xxxx 16/04/2012 17:00:53 - xxxx738 - A234 - Time=        82 ms. 
xxxx 16/04/2012 17:00:53 - xxxx739 - R234 - Time=       127 ms. 
xxxx 16/04/2012 17:00:53 - xxxx746 - R234 - Time=        37 ms. 
xxxx 16/04/2012 17:00:53 - xxxx743 - E234 - Time=       176 ms. 
xxxx 16/04/2012 17:00:53 - xxxx744 - R234 - Time=       188 ms. 
xxxx 16/04/2012 17:00:53 - xxxx748 - A234 - Time=        37 ms. 
xxxx 16/04/2012 17:00:53 - xxxx751 - A234 - Time=        61 ms.


I would just like to take on a cron every minute and then generate the statistics (the statistics awk armed I have it) but I need this to give a range of times.


Thanks for your help!

Best Regards!

Moderator's Comments:
Mod Comment Code tags for code, please.
 

10 More Discussions You Might Find Interesting

1. Programming

linux 7.1 goes off every other minute

i have loaded linux 7.1 on my PC along with win98 the problem is that every other minute th system goes off please help me (1 Reply)
Discussion started by: vidya_harnal
1 Replies

2. Programming

how can i run a process for a whole minute?

here's the problem, i have two processes that i need to run and both process should be run at a total of 1 minute each. how do i do that? and one more here's what the processes do: the 1st process show the '+" sign infinitely while the 2nd process displays the "-" infinitely. how could i count the... (1 Reply)
Discussion started by: kelogs1347
1 Replies

3. Shell Programming and Scripting

scripting running every minute

Hi Experts, below similar thread i posted earlier. Although i wish to know ur suggestion newly. I want to run a script every 1 minute. I tried with Crontab. But the problem is cron send every 1 mins invertal- mail to the user mailbox. meanwhile, some expert telling me it is not wise to... (15 Replies)
Discussion started by: thepurple
15 Replies

4. Shell Programming and Scripting

How do i get only last 5 minute worth of data

I have a text file called 'tomcat_temp_out'. I want to get only last 5 minute worth of data from this file and redirect those data into another fule. Could you please help to work on this? (2 Replies)
Discussion started by: shivanete
2 Replies

5. Shell Programming and Scripting

Crontab for every minute or every hour

How to set crontab for every minute or every hour (1 Reply)
Discussion started by: kaushik02018
1 Replies

6. Shell Programming and Scripting

Process file every minute

Hey guy's, How can I schedule this script using AWK, what I require is it runs every minute as new data will be added to the file? And I need to capture these data and save it to the output file. I tried using sleep 1 to allow the file to be processed but is not working. awk ' ... (35 Replies)
Discussion started by: James_Owen
35 Replies

7. Shell Programming and Scripting

Count of matched pattern occurences by minute and date in a log file

Anyone knows how to use AWK to achieve the following Sun Feb 12 00:41:01-00:41:59 Success:2 Fail:2 Sun Feb 12 00:42:01-00:42:59 Success:1 Fail:2 Sun Feb 12 01:20:01-01:20:59 Success:1 Fail:2 Mon Feb 13 22:41:01-22:41:59 Success:1 Fail:1 log file: Success Success Fail Fail ... (9 Replies)
Discussion started by: timmywong
9 Replies

8. Shell Programming and Scripting

Check log file size every 10 minute. Alert if log not update

How to check log size every 10min. by script (can use crontab) if log size not change with alert "Log not update" Base run on SunOS 5.8 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" Out put. Tue Jan 31... (3 Replies)
Discussion started by: ooilinlove
3 Replies

9. Shell Programming and Scripting

[solved] Awk/shell question to parse hour minute from text

Hi, I have a quick question on parsing the hour/minute and value from a text file and remove the seconds portion. For example in the below text file: 20:26:01 95.83 20:27:01 96.06 20:28:01 95.99 20:29:01 7.11 20:30:01 5.16 20:31:01 8.27 20:32:02 9.79 20:33:01 11.27 20:34:01 7.83... (2 Replies)
Discussion started by: satishrao
2 Replies

10. Shell Programming and Scripting

Minute(4) issue in teradata

I have values below for which diff field is giving error like "invalid time interval" in teradata Might be it is not doing calculation anymore after exceeding minute(4) value END_TS 2/2/2018 08:50:49.000000 START_TS 1/5/2018 17:30:02.000000 SLA_TIME 23:59:59.000000 select... (0 Replies)
Discussion started by: himanshupant
0 Replies
UNICODE_START(1)					      General Commands Manual						  UNICODE_START(1)

NAME
unicode_start - put keyboard and console in unicode mode SYNOPSIS
unicode_start [font [umap]] DESCRIPTION
The unicode_start command will put the keyboard and console into Unicode (UTF-8) mode. For the keyboard this means that one can attach 16-bit U+xxxx values to keyboard keys using loadkeys(1), and have these appear as UTF-8 input to user programs. Also, that one can type hexadecimal Alt-xxxx using the numeric keypad, and again produce UTF-8. For the console this means that the kernel expects UTF-8 output from user programs, and displays the output accordingly. The parameter font is a font that is loaded. It should have a built-in Unicode map, or, if it hasn't, such a map can be given explicitly as second parameter. When no font was specified, the current font is kept. NOTE
Unicode mode is a parameter with a value per virtual console. However, usually the font and keymap is common to all consoles. SEE ALSO
dumpkeys(1), kbd_mode(1), loadkeys(1), unicode_stop(1), utf-8(7), setfont(8) 3 Feb 2001 UNICODE_START(1)
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy