split_squid: split the "status_code" field in a Squid-formatted dataset.

Description Usage Arguments Value See Also Examples

View source: R/splitters.R

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

1
split_squid(status_codes)

Arguments

status_codes

a status_code column from a Squid file read in with read_squid

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), NAs will be returned.

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

1
2
3
#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)

Ironholds/webreadr documentation built on April 11, 2018, 11:48 p.m.