read_log() would benefit from the trim_ws argument available in read_delim(). Logfiles with single digit dates generate an empty column due to the fact that the date in the logfile is given as "Nov[space][space]4" instead of "Nov[space]4". Example:
library(readr)
logfile <- read_log("logfile",col_types=cols(.default="c"),col_names=FALSE,progress=FALSE)
with data:
Nov 4 00:00:55 vrpweb1 httpd: 131.161.8.219 - - [04/Nov/2017:00:00:55 -0400] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 HTTP/1.1" 200 10056 "http://www.colby.edu/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"
Nov 4 00:00:55 vrpweb1 httpd: 131.161.8.216 - - [04/Nov/2017:00:00:55 -0400] "GET /wp-content/plugins/wooslider-AxZp6o/assets/js/jquery.flexslider.min.js?ver=2.4.1-20170608 HTTP/1.1" 200 22414 "http://www.colby.edu/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"
will generate an empty column "X2". The trim_ws argument would remove this extra whitespace.
read_log() would benefit from the trim_ws argument available in read_delim(). Logfiles with single digit dates generate an empty column due to the fact that the date in the logfile is given as "Nov[space][space]4" instead of "Nov[space]4". Example:
with data:
will generate an empty column "X2". The trim_ws argument would remove this extra whitespace.