Sunday, November 18, 2012

Seeing the Results of People Using Dendrite Network

The Dendrite Network works by logging interactions and publishing that log.  You can then use tools to sift through the log and find the information you're looking for.

The simplest tools to use are the venerable command-line file processing utilities that come with most GNU/Linux systems.  Here is an example of finding all the unique URL registration events in a log file:
$ grep register dendnet.log | awk '{print $4, $5 }' | sort | uniq

1fvuqxgdentxqnnpc0071hq45 u'https://github.com/PhoenixBureau/DendNet'
1p9d4ew8a7mf2gpabrdqhtgdh u'http://openkeyval.org/'
d2i04eshhhg10lz6szytitcsh u'http://www.phoenixbureau.org/'
If we break it down it works like this:
grep register dendnet.log
That command finds all the lines in the log for URL registration events.
awk '{print $4, $5 }'
This prints out each line with only the tag and URL, separated by a space.
 sort | uniq
Last but not least, we sort the lines and remove duplicates.

No comments: