Pure-ruby implementation of grok.