split_squid {webreadr} | R Documentation |
split the "status_code" field in a Squid-formatted dataset.
Description
the Squid data format (which can be read in with
read_squid
) stores the squid response and the HTTP status
code as a single field. split_squid
allows you to split
these into a data.frame of two distinct columns.
Usage
split_squid(status_codes)
Arguments
status_codes |
a |
Value
a data.frame of two columns - "squid_code" and "http_status" - representing, respectively, the Squid response to the request and the HTTP status of it. In cases where the status code is not intact (containing, for example, just the squid_code) a row of empty strings will currently be returned. In the future, this will be somewhat improved.
See Also
read_squid
for reading these files in,
and split_clf
for similar parsing of multi-field
columns in Common/Combined Log Format (CLF) data.
Examples
#Read in an example Squid file provided with the webtools package, then split out the codes
data <- read_squid(system.file("extdata/log.squid", package = "webreadr"))
statuses <- split_squid(data$status_code)