R code to mine log files