blob: 8dae39a2c4ef0994400152cb97303a599e935990 (
plain)
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
|
#!/usr/bin/env awk
#
# cat outlog | grep "VERSION.BIND" | awk -f BIND-distribution.awk
#
BEGIN {
FS = "\""
hostcount = 0
}
/^[0-9\.]+ VERSION\.BIND\. \"[^\"]+\"$/ {
# count one to the overall distribution countage
distribution[$2] += 1
# count the overall distributions
hostcount += 1
}
END {
for (distrib in distribution) {
printf ("/%s//%d/%.2f/\n", distrib, \
distribution[distrib], \
(distribution[distrib] * 100) / hostcount)
}
}
|