-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloganalysis
More file actions
executable file
·38 lines (36 loc) · 1.75 KB
/
loganalysis
File metadata and controls
executable file
·38 lines (36 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
if [[ $1 == "--help" ]]
then
echo Usage: $( basename $0 ) [filename]...
echo
echo Reads from stdin if no filenames provided.
exit 1
fi
cut -d\ -f4- "${@}" \
| sed \
-e 's/^[[:space:]]\+//' \
-e 's/\[[0-9A-Z]\{320,\}\]/\[validation?\]/' \
-e 's/\("\(\(parent_\)\?close_time\|total\(C\|_c\)oins\)":"\?[0-9]\{2\}\)[0-9]\+\>/\1NNNNNN/g' \
-e 's/"\(tx_json\|result\)":{[^}]*}/"\1":{...}/g' \
-e 's/"\(tx_blob\|Domain\)":"[0-9A-F]\+"/"\1":"..."/g' \
-e 's/\<[0-9A-F]\{66\}\>/**PUBLIC KEY**/g' \
-e 's/\<[0-9A-F]\{64\}\>/**HASH**/g' \
-e 's/\<n[0-9a-zA-Z]\{51\}\>/**NODE ID**/g' \
-e 's/\<r[1-9A-HJ-NP-Za-km-z]\{24,34\}\>/**ACCOUNT ID**/g' \
-e 's/\<[0-9.]\+\(e-\?[0-9]\+\)\?\(\/\)[A-Z0-9]\{3,40\}\(\/\*\*ACCOUNT ID\*\*\)/**IOUAMT**/g' \
-e 's/\<[0-9.]\+\(e-\?[0-9]\+\)\?\(\/XRP\)/**XRPAMT**/g' \
-e 's/\(Attempting cross: \)\*\*ACCOUNT ID\*\*\/[A-Z0-9]\{3,40\}\( -> XRP\)/\1**IOU**\2/' \
-e 's/\(Attempting cross: XRP -> \)\*\*ACCOUNT ID\*\*\/[A-Z0-9]\{3,40\}/\1**IOU**/' \
-e 's/\(Attempting cross: \)\(\*\*ACCOUNT ID\*\*\/[A-Z0-9]\{3,40\}\( -> \)\?\)\{2\}/\1**IOU**\3**IOU**/' \
-e 's/\<2147483647\>/MAXINT32/g' \
-e 's/\<18446744073709551615\>/MAXINT64/g' \
-e 's/\(\([oO]ffer\( #\)\?\|order\) \)\<[0-9.]\+\(e-\?[0-9]\+\)\?\>/\1#/' \
-e 's/\<[0-9A-Z]\{40\}\>/**PEER ID**/g' \
-e 's/\<\(6[7-9][0-9]\|2[3-9][0-9]\)[0-9]\{5\}\>/\1XXXXX/g' \
-e 's/\(^\(Protocol\|Peer\):.*\[\)[0-9]\+\]/\1*ID*\]/' \
-e 's/\<[0-9.]\+\(e-\?[0-9]\+\)\?\(ms\|seconds\)/#\2/g' \
-e 's/\[[:.0-9a-f]\{3,39\}\]\|[0-9a-f]\{1,4\}\(:[0-9a-f]\{0,4\}\)\{2,6\}:[0-9a-f]\{1,4\}/**IP**/g' \
-e 's/\<[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\>/**IP**/g' \
-e 's/\<[0-9.]\+\(e-\?[0-9]\+\)\?\>/#/g' \
| sort \
| uniq -c