Hacker News new | ask | show | jobs
by alexberghage 4533 days ago
The shell exec magic, especially when combined with notebook mode and pylab inline, can make some simple analyses of text data really dead simple. You can, for example, do something like:

    my_data = !find . | grep .log | xargs grep interesting_event | awk '{print $3}'
    map(float, my_data)
    hist(my_data, 12)
Which will dump out a nice pretty 12-bin histogram of whatever the numeric data in the third column of output, of messages containing interesting_event was. To get this sort of fancy, run `ipython notebook --pylab=inline` and enjoy!

EDIT: for context, I wind up using this all the time to tease out information from Riak logs, like how long Bitcask merges take, in aggregate, and for locating particular events in time and characterizing their frequency.