{"id":608,"date":"2012-03-24T12:49:10","date_gmt":"2012-03-24T20:49:10","guid":{"rendered":"http:\/\/raffy.ch\/blog\/?p=608"},"modified":"2012-03-24T12:49:10","modified_gmt":"2012-03-24T20:49:10","slug":"advanced-network-graph-visualization-with-afterglow","status":"publish","type":"post","link":"https:\/\/raffy.ch\/blog\/2012\/03\/24\/advanced-network-graph-visualization-with-afterglow\/","title":{"rendered":"Advanced Network Graph Visualization with AfterGlow"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/raffy.ch\/blog\/wp-content\/uploads\/2012\/03\/graph-300x289.png\" alt=\"\" title=\"graph\" width=\"300\" height=\"289\" style=\"float:right\"\/>There are cases where you need fairly sophisticated logic to visualize data. Network graphs are a great way to help a viewer understand relationships in data. In my last blog post, I explained how to <a href=\"http:\/\/raffy.ch\/blog\/2012\/03\/21\/visualizing-packet-captures-for-fun-and-profit\/\">visualize network traffic<\/a>. Today I am showing you how to extend your visualization with some more complicated configurations.<\/p>\n<p>This blog post was inspired by an <a href=\"http:\/\/afterglow.sf.nt\">AfterGlow<\/a> user who emailed me last week asking how he could keep a list of port numbers to drive the color in his graph. Here is the code snippet that I suggested he use:<\/p>\n<p><code>variable=@ports=qw(22 80 53 110);<br \/>\ncolor=\"green\" if (grep(\/^\\Q$fields[0]\\E$\/,@ports))<\/code><\/p>\n<p>Put this in a configuration file and invoke AfterGlow with it:<\/p>\n<p><code>perl afterglow.pl -c file.config | ... <\/code><\/p>\n<p>What this does is color all nodes green if they are part of the list of ports (22, 80, 53, 110). I am using <i>$fields[0]<\/i> to reference the first column of data. You could also use the function <i>fields()<\/i> to reference any column in the data.<\/p>\n<p>Another way to define the variable is by looking it up in a file. Here is an example:<\/p>\n<p><code>variable=open(TOR,\"tor.csv\"); @tor=<tor>; close(TOR);<br \/>\ncolor=\"red\" if (grep(\/^\\Q$fields[1]\\E$\/,@tor))<\/tor><\/code><\/p>\n<p>This time you put the list of items in a file and read it into an array. Remember, it&#8217;s just Perl code that you execute after the <i>variable=<\/i> statement. Anything goes! <\/p>\n<p>I am curious what you will come up with. Post your experiments and questions on <a href=\"http:\/\/secviz.org\">secviz.org<\/a>!<\/p>\n<p>Read more about how to use AfterGlow in <a href=\"http:\/\/secviz.org\/content\/applied-security-visualization\">security visualization<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are cases where you need fairly sophisticated logic to visualize data. Network graphs are a great way to help a viewer understand relationships in data. In my last blog post, I explained how to visualize network traffic. Today I am showing you how to extend your visualization with some more complicated configurations. This blog [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3,2],"tags":[],"class_list":["post-608","post","type-post","status-publish","format-standard","hentry","category-log-analysis","category-programming","category-visualization"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/comments?post=608"}],"version-history":[{"count":3,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/608\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/608\/revisions\/613"}],"wp:attachment":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/categories?post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/tags?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}