Commit | Line | Data |
---|---|---|
75b23ff8 SK |
1 | #! /usr/bin/awk -f |
2 | ||
3 | BEGIN { | |
4 | FS = msg_fs ? msg_fs : "|" | |
5 | OFS = msg_fs ? msg_fs : "|" | |
6 | Kfs = key_fs ? key_fs : ":" | |
7 | } | |
8 | ||
9 | # Modify the record we're interested in | |
10 | $1 == status && $2 == src && ($3 ~ ("^" key_prefix)) { | |
11 | key = $3 | |
12 | val = $4 | |
13 | prev[key] = curr[key] | |
14 | curr[key] = val | |
15 | diff[key] = curr[key] - prev[key] | |
16 | print($1, $2, $3, diff[key]) | |
17 | next | |
18 | } | |
19 | ||
20 | # Let everything else through untouched | |
21 | // |