Advertisement

11.17.2008 at 12:04PM PST, ID: 23912029 | Points: 500
[x]
Attachment Details

AWK - Array creation, sorting & filtering

Experts:
Good afternoon.  I'm attempting to split a log file (containg particular FIX messages) into an array and running into difficulties.  

RAW DATA:
2008/11/17 09:41:12:504: FIXConnectionData: Sending data on connection {THEM} [8=FIX.4.2|9=0072|35=A|57=A|50=2988|34=1|49=USSS|56=THEM|52=20081117-14:41:12|98=0|108=30|10=092|]
2008/11/17 09:41:12:510: FIXPump: Received data on connection {THEM} [8=FIX.4.2|9=0059|35=A|34=1|49=THEM|56=USSS|52=20081117-14:42:17|98=0|108=30|10=254|]
2008/11/17 09:41:42:513: FIXConnectionData: Sending data on connection {THEM} [8=FIX.4.2|9=0060|35=0|57=A|50=2988|34=2|49=USSS|56=THEM|52=20081117-14:41:42|10=051|]
2008/11/17 09:41:42:519: FIXPump: Received data on connection {USSS} [8=FIX.4.2|9=0047|35=0|34=2|49=THEM|56=USSS|52=20081117-14:42:47|10=213|]
2008/11/17 09:42:12:530: FIXConnectionData: Sending data on connection {THEM} [8=FIX.4.2|9=0060|35=0|57=A|50=2988|34=3|49=USSS|56=THEM|52=20081117-14:42:12|10=050|]
2008/11/17 09:42:12:534: FIXPump: Received data on connection {THEM} [8=FIX.4.2|9=0047|35=0|34=3|49=THEM|56=USSS|52=20081117-14:43:17|10=212|]
</RAW DATA>

What' I'd envisioned is taking the FIX tags (Everything between 8=FIX* and 10=*) putting everything before the equals sign on the index side and everything after as the valie of the index (AWK allows associative arrays, yes?) Sorting (ascending) by tag #.

<What I have>
[8=FIX.4.2
9=0072
35=A
57=A
50=2988
34=1
49=USSS
56=THEM
52=20081117-14:41:12
10=254
]
</<What I have>

Difficulties:
1. Values of the array are tag#=value.  Not index=value
2. All messages seem to be displaying not filtered by the first expression '/35=[value]/
1:
awk '/35=0/ gsub(/\001/,"|") split($0,array,"|") {for (ref in array) print array[ref]}' FIX_LOG20081116.log
 
 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by amit_g:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by amit_g:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by amit_g:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by amit_g:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by amit_g:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by amit_g:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by Just_RC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
20081119-EE-VQP-45 - Hierarchy / EE_QW_3_20080625