CommonLog
Background & Context
-
- Common Log Format.
- Also known as NCSA Common Log Format.
- Used for logging web traffic.
- Plain text format.
- Represents each record as a line of text.
- Developed by NCSA.
Import
- Import ["file","CommonLog"] imports a log file as a Tabular object.
- Import ["file",{"CommonLog",elem}] imports the specified element.
- Import ["file",{"CommonLog",elem,subelem1,…}] imports subelements subelemi, useful for partial data import.
- The format "CommonLog" must always be specified when importing common log files.
- See the following reference pages for full general information:
-
Import import from a fileCloudImport import from a cloud objectImportString import from a stringImportByteArray import from a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file"Summary" summary of the file"Rules" list of rules for all available elements
- Data representation elements:
-
"Data" two-dimensional array"Dataset" table data as a Dataset"Tabular" a Tabular object
- Import by default uses the "Tabular" element.
- Subelements for partial data import for the "Tabular" element can take row and column specifications in the form {"Tabular",rows,cols}, where rows and cols can be any of the following:
-
n nth row or column-n counts from the endn;;m from n through mn;;m;;s from n through m with steps of s{n1,n2,…} specific rows or columns ni
- Data descriptor elements:
-
"ColumnLabels" names of columns"ColumnTypes" association with data type for each column"Schema" TabularSchema object
- Columns or identifiers typically present in a common log file are:
-
"RemoteHost" remote hostname or IP number"ClientID" remote logname"RemoteUser" username used for authentication"Date" date and time of the request"RequestLine" request as given by the client"StatusCode" the HTTP status code returned to the client"ByteCount" byte size of the tranferred document
- Metadata elements:
-
"ColumnCount" number of columns stored in file"Dimensions" data dimensions"RowCount" number of rows stored in file
Import Options
- General Import options:
-
- Possible settings for the "Schema" option include:
-
schema a complete TabularSchema specification<|"prop1"val1,…|> an association of schema properties and values
Examples
open all close allBasic Examples (2)
Import a log file as a Tabular :
Import the file summary:
Scope (2)
Import metadata from a log file:
Import a sample row of a log file:
Import Elements (20)
"ColumnCount" (1)
Get the number of columns from a log file:
"ColumnLabels" (1)
Get the column labels from a log file:
"ColumnTypes" (1)
Get the inferred column types from a log file:
"Data" (6)
Import a log file as a 2D list of values:
Import a single row from a log file:
Import multiple rows:
Import the first 5 rows:
Import a single element at a given row and column:
Import a single column:
"Dataset" (1)
Import a log file as a Dataset :
"Dimensions" (1)
Get the dimensions from a log file:
"RowCount" (1)
Get the number of rows from a log file:
"Schema" (1)
Get the TabularSchema object:
"Summary" (1)
Summary of a log file:
"Tabular" (6)
Import a log file as a Tabular object:
Import a single row:
Import multiple rows:
Import the first 5 rows:
Import a single element at a given row and column:
Import a single column:
Import Options (2)
"Schema" (2)
Import automatically infers column labels and types from data stored in a log file:
Use the "Schema" option to specify column labels and types:
Related Guides
History
Introduced in 2025 (14.3)