Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


  • Import can read all common variants of the Apache log format, as well as Wolfram MathLM log files and user-customized log formats.


    Apache log files.
    Native log file format of the Apache web server.
    Common variants are Apache Common Log and Apache Access Log.
    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 record formats.

Import and ExportImport and Export

  • Import["file","ApacheLog"] imports an Apache log file.
  • Import["file","ApacheLog"] reads an Apache log file and returns the contents as a table.
  • Import["file",{"ApacheLog",elem}] imports the specified element from an Apache log file.
  • Import["file",{"ApacheLog",{elem1,elem2,}}] imports multiple elements.
  • The format must always be specified when importing Apache log files.
  • See the reference pages for full general information on Import.
  • ImportString supports Apache log formats.


  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation element:
  • "Data"content of the file represented as a list of lists
  • Import by default uses the element for Apache log files.
  • Selecting individual data fields:
  • "Attachments"files attached to the message
    "ByteCount"byte size of the object returned to the client
    "Date"date and time of the transaction, given as a string
    "Referrer"site from which the client reports having been referred
    "RemoteHost"IP address or hostname of the client
    "RemoteUser"user ID of the client as determined by HTTP authentication
    "RequestLine"the client request as a string, normally containing the path of the requested object and information about the protocol
    "SessionID"a string that identifies the user session
    "StatusCode"the status code that the server returns to the client, as defined in the HTTP specification (RFC2616)
    "UserAgent"browser identification as reported by the client


  • Import option:
  • "DataFormat"Automaticformat specification, given as a list of data representation elements and separators representing one record
  • To import a custom log format, can be used to specify the format of each record as a combination of data elements and record separators.
  • Import of Common Log files uses the setting
  • The default format of Access Log files is given by

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Import an entire log file as a list of records:

Click for copyable input

Show the Import elements available in this file:

Click for copyable input

Read only the date fields:

Click for copyable input

Read all server requests:

Click for copyable input
Introduced in 2007