nsmcp::AccessRecordParser method requestFields (public)
<instance of nsmcp::AccessRecordParser> requestFields peer \ identifier user timestamp request status bytes combined agent \ timing
Defined in /usr/local/ns/tcl/nsmcp/access-record.tcl
Build a request record from validated fields and timing. Derive authentication and request metadata while retaining explicit unknown-value representations.
- Parameters:
- peer (required)
- Logged peer address, including the supported unknown-value sentinel.
- identifier (required)
- Complete log-thread identifier, or the raw identifier field when parsing access records.
- user (required)
- Logged user identifier used to derive authentication state.
- timestamp (required)
- Parsed timestamp or timing base supplied by the parser.
- request (required)
- Decoded HTTP request-line field.
- status (required)
- Decoded HTTP response status.
- bytes (required)
- Logged response-byte value, retaining the supported unknown-value sentinel.
- combined (required)
- Whether the decoded access line uses the combined format.
- agent (required)
- Decoded User-Agent value.
- timing (required)
- Normalized request-timing dictionary.
- Returns:
- The normalized request dictionary.
- Testcases:
- No testcase defined.
Source code: set authenticationState [expr {$user in {0 -} ? "anonymous" : ($user in {{} {[REDACTED]}} ? "unknown" : "authenticated")}] set result [dict create authenticationState $authenticationState timestamp $timestamp peerAddress $peer requestIdentifier {} pool unknown method unknown url {} status $status responseBytes $bytes timingSource completion] if {[::nsmcp::logRecordParser validRequestIdentifier $identifier]} { dict set result requestIdentifier $identifier } set result [dict merge $result [::nsmcp::accessRecordIdentity $identifier]] if {[dict get $result recordSource] eq "driver"} { # Request authentication was not performed by an application worker. dict set result authenticationState unknown } # Empty/binary/probe requests remain valid access records. Extract the # ends of a request line, allowing embedded spaces in the logged target. set first [string first " " $request] set last [string last " " $request] if {$first>0 && $last>$first} { set protocol [string range $request [expr {$last+1}] end] if {[string match */* $protocol]} { dict set result method [string range $request 0 [expr {$first-1}]] dict set result url [string range $request [expr {$first+1}] [expr {$last-1}]] dict set result protocol $protocol } } elseif {[string match /* $request]} { dict set result url $request } if {$combined && ${:timingColumn} in {-2 -1 2}} { dict set result userAgent $agent } set result [dict merge $result $timing] set available [expr {[dict get $timing timingSource] eq "start" && [dict get $result recordSource] ne "driver"}] dict set result phaseTimingAvailable $available dict set result phaseTimingReason [expr {$available ? "logged-worker-phases" : ([dict get $result recordSource] eq "driver" ? "driver-synthetic-phases" : "no-phase-counters")}] if {!$available} { foreach key {acceptTime queueTime filterTime runTime} { dict unset result $key } } set path [lindex [split [dict get $result url] ?] 0] if {[regexp {^[A-Za-z][A-Za-z0-9+.-]*://[^/]*(/.*)?$} $path -> suffix]} { set path [expr {$suffix eq "" ? "/" : $suffix}] } dict set result path $path return $resultXQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)