LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   awk/perl script for extract data (https://www.linuxquestions.org/questions/linux-newbie-8/awk-perl-script-for-extract-data-583590/)

mruknown1 09-10-2007 07:14 AM

awk/perl script for extract data
 
Hello... i need awk/perl script that can calculate packet size.

for example based on this output, each column have their own meaning
column1=send/received, drop,...
column2= timestamp
column3=node
column4=level
column5=flag
column6=packetID
column7=packettype
column8=packetsize
.....
.....

1. How if i want to calculate total PACKETSIZE RECEIVED by NODE 5 with RTR LEVEL and DSR PACKETTYPE .From here i will try to manipulate the script so i can used it in my research.

2. How if i want to extract this output so i can create a new file that print 2 columns (TIMESTAMP and DSR) when NODE 5 RECEIVED DSR PACKETTYPE with RTR LEVEL.

thank you very much for any help... :)

s 84.456630640 _5_ AGT --- 0 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [0] 0 1
r 84.456630640 _5_ RTR --- 0 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [0] 0 1
s 84.460452677 _5_ RTR --- 1 DSR 32 [0 0 0 0] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461724861 _4_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461724909 _0_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461725322 _6_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461725410 _1_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
r 84.461725471 _2_ RTR --- 1 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 1] [0 1 0 0->0] [0 0 0 0->0]
s 84.462207082 _6_ RTR --- 2 DSR 44 [0 0 0 0] ------- [6:255 5:255 254 5] 2 [0 1] [1 1 2 5->6] [0 0 0 0->0]
r 84.466670604 _5_ RTR --- 2 DSR 44 [13a 5 6 800] ------- [6:255 5:255 254 5] 2 [0 1] [1 1 2 5->6] [0 0 0 0->0]
SFESTs 84.466670604 _5_ 0 [5 -> 6] 1(1) to 6 [5 |6 ]
s 84.466670604 _5_ RTR --- 0 cbr 548 [0 0 0 0] ------- [5:1 6:1 32 6] [0] 0 1
r 84.472832542 _6_ RTR --- 0 cbr 548 [13a 6 5 800] ------- [5:1 6:1 32 6] [0] 1 1
r 84.472832542 _6_ AGT --- 0 cbr 512 [13a 6 5 800] ------- [5:1 6:1 32 6] [0] 1 1
s 89.865825846 _5_ AGT --- 3 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [1] 0 2
r 89.865825846 _5_ RTR --- 3 cbr 512 [0 0 0 0] ------- [5:1 6:1 32 0] [1] 0 2
SFESTs 89.865825846 _5_ 3 [5 -> 6] 1(1) to 6 [5 |6 ]
s 89.865825846 _5_ RTR --- 3 cbr 548 [0 0 0 0] ------- [5:1 6:1 32 6] [1] 0 2
SSendFailure 89.907170846 _5_ 3 2 5:1 6:1 5->6 2 2 2 2 [|5 6 ]
s 89.912216246 _5_ RTR --- 4 DSR 32 [0 0 0 0] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
r 89.913368448 _0_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
s 89.913368448 _0_ RTR --- 5 DSR 48 [0 0 0 0] ------- [0:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
r 89.913368578 _4_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
s 89.913368578 _4_ RTR --- 6 DSR 48 [0 0 0 0] ------- [4:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
r 89.913368941 _1_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
s 89.913368941 _1_ RTR --- 7 DSR 48 [0 0 0 0] ------- [1:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
r 89.913369041 _2_ RTR --- 4 DSR 32 [0 ffffffff 5 800] ------- [5:255 6:255 32 0] 1 [1 2] [0 2 0 0->0] [0 0 0 0->0]
r 89.919259468 _5_ RTR --- 7 DSR 48 [13a 5 1 800] ------- [1:255 5:255 255 5] 2 [0 2] [1 2 3 5->6] [0 0 0 0->0]
SFESTs 89.919259468 _5_ 3 [5 -> 6] 3(1) to 1 [5 |1 6 ]
s 89.919259468 _5_ RTR --- 3 cbr 552 [13a 6 5 800] ------- [5:1 6:1 32

wjevans_7d1@yahoo.co 09-10-2007 03:56 PM

Well, we can't do your work for you, of course. But maybe we can help.

What does your script look like so far?

Tinkster 09-11-2007 04:42 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


http://www.linuxquestions.org/questi...d.php?t=582907


All times are GMT -5. The time now is 12:11 AM.