WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center
  • Import can read various standard log formats, as well as user-customized log formats.

Background

    • Log files.
    • Common variants are Common Log Format, Extended Log File Format and Apache Access Log Format.
    • Is used by MathLM, the Wolfram System license manager.
    • Plain text format.
    • Stores information about web server transactions.
    • Represents each record as a line of text.
    • Allows user-customized log formats.
    • Developed by Apache.

Import & Export

  • Import ["file","ApacheLog"] imports a log file as a Tabular object.
  • Import ["file",{"ApacheLog",elem}] imports the specified element.
  • Import ["file",{"ApacheLog",elem,subelem1,}] imports subelements subelemi, useful for partial data import.
  • The format "ApacheLog" must always be specified when importing log files.
  • See the following reference pages for full general information:
  • Import import from a file
    CloudImport import from a cloud object
    ImportString import from a string
    ImportByteArray 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 end
    n;;m from n through m
    n;;m;;s from n through m with steps of s
    {n1,n2,} specific rows or columns ni
  • Column specifications can also be any of the following:
  • "col" single column "col"
    {col1,col2,} list of column names coli
  • Data descriptor elements:
  • "ColumnLabels" names of columns
    "ColumnTypes" association with data type for each column
    "Schema" TabularSchema object
  • Metadata elements:
  • "ColumnCount" number of columns stored in file
    "Dimensions" data dimensions
    "RowCount" number of rows stored in file
Import Options
  • General Import options:
  • "DataFormat" Automatic format specification, given as a string
    "Schema" Automatic schema used to construct Tabular object
  • Possible settings for the "DataFormat" option include:
  • Automatic automatically determine format specification (default)
    "ApacheErrorLog" Apache error log format for server issues and diagnostics
    "CommonLog" Common Log Format (CLF) for basic web traffic
    "CombinedLog" common log with referrer for web analytics and SEO
    "CommonLogVHost" common log with virtual host for multi-site hosting environments
    "RefererLog" only referer log for marketing and SEO
    format arbitrary fields and record separators
  • To import a custom log format, use "DataFormat"->format to specify the format of each record consisting of data elements and record separators such as "`Field1` [`Field2`] `Field3`".
  • The format specification can be a list of strings and OptionalElement s to denote elements that may be absent in some lines.
  • Possible settings for the "Schema" option include:
  • schema a complete TabularSchema specification
    propval a schema property and value (see reference page for TabularSchema )
    <|"prop1"val1,|> an association of schema properties and values
  • Examples

    open all close all

    Basic 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  (22)

    "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"  (7)

    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:

    Import selected columns using column names:

    "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"  (7)

    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 selected columns using column names:

    Import Options  (6)

    "DataFormat"  (4)

    Import automatically infers format specification from data stored in a log file:

    Specify predefined log format:

    Use a custom format:

    Import log data with optional fields:

    "Schema"  (2)

    Import automatically infers column labels and types from data stored in a log file:

    Use "Schema" option to specify column labels and types:

    See Also

    Import   CloudImport  

    Formats: CommonLog   ExtendedLog   CSV   DBF   Ini   JavaProperties   MBOX   MDB   PHPIni   Table   TSV

    Top [フレーム]

    AltStyle によって変換されたページ (->オリジナル) /