ServerVariable - cBaseWebComponent

Allows retrieval of IIS Server Variable values

Type: Function

Return Data Type: String

Parameters: String sVariableName

ParameterDescription
sVariableNameName of the server variable to retrieve


Return Value


Syntax
Function ServerVariable String sVariableName Returns String

Call: Get ServerVariable sVariableName to StringVariable


Description

Allows retrieval of IIS Server Variable values. See Microsoft's MSDN for documentation of IIS Server Variables.

Sample

This sample shows how to obtain the value of the IIS server variable HTTP_X_FORWARDED_FOR during OnAttachProcess.

Procedure OnAttachProcess
    String sIP

    Get ServerVariable of oCustomer "HTTP_X_FORWARDED_FOR" to sIP
    If (sIP = "" or Lowercase(sIP) = "unknown") Begin
        Get ServerVariable of oCustomer "REMOTE_ADDR" to sIP
    End

    Send LogEvent 3000 sIP

    Forward Send OnAttachProcess
End_Procedure


See IIS Server Variables for a list if IIS Server Variables.