3
# For python folks: show me the equivalent code for this
7
print " title = \"Syslog picviz analysis\";\n";
11
print " timeline t [label=\"Timeline\"];\n";
12
#print " string cat [label=\"Category\"];\n";
13
print " ipv4 source [label=\"Source\"];\n";
14
print " integer port [label=\"Port\"];\n";
15
print " enum dnsaction [label=\"DNS Action\"];\n";
16
print " enum type [label=\"Type\"];\n";
17
print " string url [label=\"URL\",relative=\"true\"];\n";
27
$line =~ s/\"/\\"/g; # We escape our quotes
28
$line =~ s/&//g; # We escape our quotes
29
$line =~ s/<//g; # We escape our quotes
30
$line =~ s/>//g; # We escape our quotes
32
$line =~ m/.* (\d+:\d+:\d+).\d+ (\S+): (\S+): \S+ (\d+.\d+.\d+.\d+)#(\d+): (.*) '(.*)\/(.*)\/(.*)' (.*)/;
34
# print "$1,$2,$3,$4,$5,$6,$7,$8,$9,$10\n";
39
$msgtype=$3; # info, warning, error
48
# 29-Jul-2008 09:14:09.692 update-security: error: client 84.91.74.38#32773: update 'mylinux.net/IN' denied
49
if ($msgtype =~ m/error/) {
50
print "t=\"$t\", source=\"$source\", port=\"$port\", dnsaction=\"$dnsaction\", type=\"$type\", url=\"$url\" [color=\"red\"];\n";
53
if ($msgtype =~ m/warning/) {
54
print "t=\"$t\", source=\"$source\", port=\"$port\", dnsaction=\"$dnsaction\", type=\"$type\", url=\"$url\" [color=\"orange\"];\n";
57
if ($msgtype =~ m/info/) {
58
print "t=\"$t\", source=\"$source\", port=\"$port\", dnsaction=\"$dnsaction\", type=\"$type\", url=\"$url\" [color=\"blue\"];\n";
63
print "t=\"$t\", cat=\"$cat\", source=\"$source\", port=\"$port\", dnsaction=\"$dnsaction\", url=\"$url\", type=\"$type\" [color=\"red\"];\n";