Skip to main content

Custom

Seer Box side configuration

The Custom format allows you to create a format that fits traffic logs sent by any source that is not one of the Seer Box default sources. To set it up, simply select the value Custom in the Log type field in step 3 of traffic source creation.

info

Creating a custom format is an advanced operation that requires in-depth knowledge of the identified log format. We recommend you to proceed only after consulting the source documentation.

Log format field

The Log format field allows you to build the output log format of the selected traffic source using appropriate keywords, so that it can be correctly interpreted by Seer Box.

The available keywords trace all specific fields of an HTTP transaction (request and response) and are identified by the `%' symbol used as the first character.

Default keywords

KeywordDescription
%transaction_idHTTP transaction ID
%timestampTimestamp, to be defined in the Date/Time format field
%dateDate-only timestamp, to be defined in the Date/Time format field
%timeHour-only timestamp, to be defined in the Date/Time format field
%timezoneTimezone, to be defined in the Date/Time format field
%client_addressRequest source IP address
%client_portRequest source port
%server_addressRequest destination IP address
%server_portRequest destination port
%q_Host_Request URL domain
%pathRequest URL uri path
%urlRequest URL
%methodRequest method (eg. POST, GET, ...)
%protocolRequest HTTP version
%query_stringRaw request query string
%q_Referer_Request Referer header
%status_codeServer response code (eg. 404, 200, ...)
%request_bodyRequest body
%response_bodyResponse body
%request_bytesRequest bytes sent
%response_bytesResponse bytes received
%q_User-Agent_Request User-Agent header
%q_Cookie_Request Cookie header
%q_Content-Type_Request Content-Type header
%r_Content-Type_Request Content-Type response
%q_X-Forwarded-For_Request X-Forwarded-For header

Custom keywords

If an HTTP request or response header is not among the default keywords, it can be defined using the following syntax:

  • For a request header: %q_FIELD-NAME_ (eg: %q_Custom-Req-Field_)
  • For a response header: %r_FIELD-NAME_ (eg: %q_Custom-Resp-Field_)

This keyword is processed using the name defined in the format.

Special keywords

If the log format contains unknown fields or fields that should not be processed and analyzed, it is possible to ignore their presence with the special %ignore syntax.

Examples

Log row

66.249.75.237 - - [11/Sep/2022:06:42:21 +0200] "GET /robots.txt HTTP/1.1" 200 1969

Log format

%client_address %q_Remote-Logname_ %q_Remote-User_ [%timestamp] "%method %path %protocol" %status_code %response_bytes

Date/Time format field

The Date/Time format field characterizes the specific format of the keywords %timestamp, %date, %time and %timezone.

The first can be used in cases where the timestamp is entirely defined within a single field. The other three allow the date, time, and timezone to be separated into different fields.

There are 3 available options for Date/Time format field:

  1. unix - UNIX Timestamp
  2. timestamp - ISO/IEC 9899:2018 strftime for timestamp format representation. It also needs Timestamp and Time zone fields to be defined.
  3. datetime - ISO/IEC 9899:2018 strftime for date and time format representation. It also needs Date and/or Time, and Time zone fields to be defined.

Timestamp/Date/Time fields

Timestamp, Date and Time fields define the specific format for the time stamp representation, using the following specifiers:

SpecifierDescriptionExample
%aAbbreviated weekday nameSun
%AFull weekday nameSunday
%bAbbreviated month nameMar
%BFull month nameMarch
%cDate and time representationSun Aug 19 02:56:02 2012
%dDay of the month (01-31)19
%HHour in 24h format (00-23)14
%IHour in 12h format (01-12)05
%jDay of the year (001-366)231
%mMonth as a decimal number (01-12)08
%MMinute (00-59)55
%pAM or PM designationPM
%SSecond (00-61)02
%UWeek number with the first Sunday as the first day of week one (00-53)33
%wWeekday as a decimal number with Sunday as 0 (0-6)4
%WWeek number with the first Monday as the first day of week one (00-53)34
%xDate representation08/19/12
%XTime representation02:50:06
%yYear, last two digits (00-99)01
%YYear2012
%ZTimezone name or abbreviationCDT
%zTimezone positive/negative integer+0100

Examples

Timestamp

11/Sep/2022:06:42:21 +0200

Format

%d/%b/%Y:%H:%M:%S %z

Time zone field

The timezone of the HTTP transactions, formatted like "+0000" or "-0000".