dcsformat Parameter
  • 29 Nov 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

dcsformat Parameter

  • Dark
    Light
  • PDF

The optional dcsformat parameter is used to specify the response format when sending data to the Webtrends data collection server.

Use the dcsformat parameter to specify the format the data collection server returns in the response body. Possible values are plain and xml. If no format is specified, the data collection server returns plain text.

When an XML response includes data with XML reserved characters (ampersand, less than, greater than, apostrophe, or quote characters), these characters are converted to entity references.

Choosing a Format

Typically, you use dcsformat with the dcsverbose parameter to determine the format for debugging information. When you set dcsverbose to true, the log file line that would be submitted to the SDC server is returned in the response body.

  • plain format returns the log line exactly as written in W3C Extended Log File Format. This format is machine-readable, but can be useful for quick data validation.
  • XML format returns the data surrounded by XML tags. This format separates each field in the log line and is easier to scan visually.

Sample Request: Successful with XML Format (dcsverbose=true)

POST /v1/dcs9x99xxxx9xxxxxxx9xxxx9x_9x9x/events.svc?dcsverbose=true&dcsformat=xml
Content-Type: application/x-www-form-urlencoded
Content-Length: 111
dcsuri=/Home&dcsua=My%20Client&WT.ti=My%20Home%20Page&WT.tz=-8&WT.cg=My%20Content%20Group&customparam=customval

Sample Response: Successful with XML Format (dcsverbose=true)

HTTP/1.0 200 OK
Connection: close
Content-Type: text/xml
Content-Length: 514
<?xml version="1.0" encoding="UTF-8"?>
<fields>
<date>2009-05-08
<time>23:56:04
<c-ip>10.62.81.60
<cs-username>-
<cs-host>-
<cs-method>POST
<cs-uri-stem>/Home
<cs-uri-query>WT.ti=My%20Home%20Page&WT.tz=-8&WT.cg=My%20Content%20Group&customparam=customval
<sc-status>200
<sc-bytes>-
<cs-version>-
<cs-user-agent>My%20Client
<cs-cookie>-
<cs-referer>-
<dcs-id>dcs5w0txb10000wocrvqy1nqm_6n1p
</fields>

Sample Request: Failed with Text Format (dcsverbose=true)

POST /v1/asdf;lkjh/events.svc?dcsverbose=true
Content-Type: application/x-www-form-urlencoded
Content-Length: 111
dcsuri=/Home&dcsua=My%20Client&WT.ti=My%20Home%20Page&WT.tz=-8&WT.cg=My%20Content%20Group&customparam=customval

Sample Response: Failed with Text Format

HTTP/1.0 400 Bad Request
Connection: close
Content-Type: text/plain
Content-Length: 91
ERR_INVALID_DCS_ID
The following invalid hit was discarded due to an invalid DCSID:asdf;lkjh


Was this article helpful?