How to parse a list of data to find the missin stats.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to parse a list of data to find the missin stats.
# 1  
Old 08-08-2008
Error How to parse a list of data to find the missin stats.

HI ALL,

Thanks for helping me with my last post. Smilie

I have one more doubt, i want to parse a set of data. which is consisting of some values that occured in particular period of time.
And when i parse down if there is a missing time period then it should show the two rows between which the data is missing.


the example of entries in the table is given below:-
like there is missing data between 04:10:08 and 04:12:08, same way down the list marked in red.

How do i show the missing value of 04:11:08 that falls betweeen 04:10:08 and 04:12:08.

05/29/2008 04:09:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:10:08 - avg: 7 max: 25 min: 1 samples: 22 total: 161
05/29/2008 04:12:08 - avg: 4 max: 12 min: 1 samples: 9 total: 41

05/29/2008 04:13:08 - avg: 7 max: 51 min: 1 samples: 10 total: 70
05/29/2008 04:14:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:15:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:16:08 - avg: 4 max: 13 min: 1 samples: 8 total: 33
05/29/2008 04:18:08 - avg: 4 max: 24 min: 1 samples: 9 total: 42
05/29/2008 04:22:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17

05/29/2008 04:23:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:24:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:25:08 - avg: 8 max: 24 min: 1 samples: 18 total: 160
05/29/2008 04:26:08 - avg: 4 max: 12 min: 1 samples: 9 total: 41
05/29/2008 04:27:08 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:28:08 - avg: 6 max: 50 min: 1 samples: 11 total: 71
05/29/2008 04:29:09 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:30:09 - avg: 2 max: 5 min: 1 samples: 7 total: 17
05/29/2008 04:31:09 - avg: 4 max: 13 min: 1 samples: 8 total: 33
05/29/2008 04:32:09 - avg: 5 max: 24 min: 1 samples: 9 total: 45
05/29/2008 04:33:09 - avg: 3 max: 12 min: 1 samples: 9 total: 30


Thanks a lot.
Adi Smilie
# 2  
Old 08-08-2008
Question How often check the log?

And how big will the log be?

For instance, could do something like the following - combination of unix commands and pseudo-code. The following logic would apply best if every hour the log file is 'new' and you want to check for missing items.

Code:
cat logfile | cut -d" " -f2 | cut -d":" -f1-2 >logfile2 # gives hours and minutes

then do a loop
min=0
while [ $min -lt 60 ]
  do
  # see if the hour:$min exists in the logfile2
  # if not, create your warning
  min=((min + 1))
done

# 3  
Old 08-08-2008
The log has about 1000+ lines of entry
# 4  
Old 08-08-2008
Tools

1000 lines means one day?
Since 24 hours times 60 minutes = 1440 minutes --> 1440 lines expected

Thus, what I wrote before just needs another loop (outside the minute loop) to cycle thru the hours in a day, from 0 to 23.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Need command to parse data

Hi Friends, I have data like below t064266 I want output into this format t064266 Data are space delimited and i want parse third column data. Thanks (9 Replies)
Discussion started by: Jagaat
9 Replies

2. Shell Programming and Scripting

Parse mtr stats

Hi, I am trying to parse mtr stats. On each hop if Loss > 0 then I need to email the entire stats. IFS=' ';for i in `cat mtrres `; do VAL=$(echo $i|awk -F" " '{print $2}' | awk -F"." '{print $1}'); if ; then echo "send email"; exit 0; fi;done Filename: mtrres 192.168.1.10 ... (1 Reply)
Discussion started by: ashokvpp
1 Replies

3. Shell Programming and Scripting

Find common entries in 2 list and write data before it

Hi all, I have 2 files: second file I want if entries in one file will match in other file. It shuld wite approve before it so output shuld be (1 Reply)
Discussion started by: manigrover
1 Replies

4. Shell Programming and Scripting

Parse data

Guys , please help me out with another AWK solution ... Input Device Physical Name : Not Visible Device Symmetrix Name : 0743 Front Director Paths (2): { ---------------------------------------------------------------------- ... (5 Replies)
Discussion started by: greycells
5 Replies

5. Shell Programming and Scripting

find string(s) in text file and nearby data, export to list help

Hi, So I'm kinda new to shell scripts and the like. I've picked up quite a bit of use from browsing the forums here but ran into a new one that I can't seem to find an answer for. I'm looking to parse/find a string AND the next 15 or so charachters that follow the string within a text file... (1 Reply)
Discussion started by: kar23me
1 Replies

6. Shell Programming and Scripting

Parse data

hi i have a file p1.htm <div class="colorID2"> aaaa aaaa aa <br/> bbbbbbbb bbb<br/> <br/>cccc ccc ccc </div><div class="colorID1"> dddd d ddddd<br/> eeee eeee eeeeeeeeee<br/> fffff <br/>g gg<br/> (5 Replies)
Discussion started by: saw7
5 Replies

7. Shell Programming and Scripting

How to parse data?

Hi all, I have output of paction command looking like this: RELCI 0 IP address 1.2.16.3 Xmit: CURRENT Recv: WAIT_HEADER 0 congestions 2617/0 buf. sent/rec Xmit: CURRENT Recv: WAIT_HEADER 0 congestions 0/0 buf. sent/rec BUFFER Xmit: ... (6 Replies)
Discussion started by: sameucho
6 Replies

8. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

9. Shell Programming and Scripting

parse data using sh script

Hi, I am a newbie to unix/shell scripting and i have a question on how to parse a txt file using perl in a sh script. I have a txt file that contains hundreds of lines with data like this.... X, Y, Latitude, Longitude 1, 142, -38.000000, -91.000000, 26.348 2, 142, 60.000000, -90.000000,... (2 Replies)
Discussion started by: moonbaby
2 Replies

10. Shell Programming and Scripting

Parse a range of data

Hello, I have a file which has a range of date like: 00:00 test 00:01 test2 00:02 test3 00:03 test4 00:04 test5 00:05 test6 Using input (stdin) i would like to parse the data 00:01 to 00:04. The output file should be like this: 00:01 test2 00:02 test3 00:03 test4 00:04 test5 ... (5 Replies)
Discussion started by: BufferExploder
5 Replies
Login or Register to Ask a Question