logFileRead | R Documentation |
This function reads a file, parsing it for the fields specified, and normalises the values that have been read.
The log file is assumed to be space delimited, which is the case for Apache and IIS.
logFileRead(fileName,
columnList=c("MSTimestamp", "clientip", "url", "httpcode", "elapsed"),
logTimeZone = "",
timeFormat = "")
fileName |
The name, including path, of the file to read | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
columnList |
The columns in the file, in order. Columns are:
One timestamp and one elapsed time column name must be specified. The Apache URL is handled partly in the fix data procedure in the config file because it wraps the operation and URL path in one field. The IIS URL does not need this additional parsing. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
logTimeZone |
The timezone to use to adjust the timestamps in the log. This is used primarily for IIS logs where the log may be either UTC or local time. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
timeFormat |
If the timestamp in the log is not in the default for IIS or Apache this can be used to override the timestamp parsing. The format is the r strptime format. |
The function returns a dataframe that contains the contents of the file.
Greg Hunt <greg@firmansyah.com>
logFileName = logFileNamesGetLast(dataDirectory=datd,
directoryNames=c(".", "."),
fileNamePattern="*[.]log")[[1]]
cols = logFileFieldsGetIIS(logFileName)
logdf = logFileRead(logFileName, columnList=cols,
logTimeZone = "", timeFormat = "")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.