DB EXA records with parameters


#1

This trigger and associated record format will create a DB_Advanced record type that includes parameters for Databases where we support capturing the parameters (like MSSQL). Just apply the included trigger to databases you want to capture parameters from, add the DB_REQUEST and DB_RESPONSE events to the trigger and create a new record format DB_Advanced (pasting in the record format here)

Sample data:

Trigger:

if (event == 'DB_REQUEST') {
    var parameters = DB.params;
    var paramstring = '';
    if (parameters) {
        for ( var i = 0; i < parameters.length; i++ ) {
            if (parameters[i].name) {
                paramstring += parameters[i].name + " : ";
            }
            if (parameters[i].reqSize) {
                paramstring += parameters[i].reqSize + " : ";
            }
            if (parameters[i].value) {
                paramstring += parameters[i].value;
            }
            if (paramstring != '') {
                paramstring += "\n";
            }
        }
    }
    Flow.store.params = paramstring;
}
if (event == 'DB_RESPONSE') {
    var record = DB.record;
    record.parameters = Flow.store.params;
    commitRecord('DB_Advanced',record);
}

Record Format:

[
{
    "display_name": "Application",
    "name": "application",
    "data_type": "app",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Flow",
    "name": "flowId",
    "data_type": "s",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Client",
    "name": "client",
    "data_type": "dev",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Client Address",
    "name": "clientAddr",
    "data_type": "addr4",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Client IPv6 Address",
    "name": "clientAddr",
    "data_type": "addr6",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Client Port",
    "name": "clientPort",
    "data_type": "n",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Server",
    "name": "server",
    "data_type": "dev",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Server Address",
    "name": "serverAddr",
    "data_type": "addr4",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Server IPv6 Address",
    "name": "serverAddr",
    "data_type": "addr6",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Server Port",
    "name": "serverPort",
    "data_type": "n",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Client Zero Windows",
    "name": "clientZeroWnd",
    "data_type": "n",
    "meta_type": "count",
    "description": ""
},
{
    "display_name": "Server Zero Windows",
    "name": "serverZeroWnd",
    "data_type": "n",
    "meta_type": "count",
    "description": ""
},
{
    "display_name": "Correlation ID",
    "name": "correlationId",
    "data_type": "n",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Method",
    "name": "method",
    "data_type": "s",
    "facet": true,
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Error",
    "name": "error",
    "data_type": "s",
    "facet": true,
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Database",
    "name": "database",
    "data_type": "s",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Statement",
    "name": "statement",
    "data_type": "s",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "User",
    "name": "user",
    "data_type": "s",
    "meta_type": "user",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Processing Time",
    "name": "processingTime",
    "data_type": "n",
    "meta_type": "milliseconds",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Request Aborted",
    "name": "isReqAborted",
    "data_type": "b",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Response Aborted",
    "name": "isRspAborted",
    "data_type": "b",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Procedure",
    "name": "procedure",
    "data_type": "s",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Request Bytes",
    "name": "reqBytes",
    "data_type": "n",
    "meta_type": "bytes",
    "description": ""
},
{
    "display_name": "Request L2 Bytes",
    "name": "reqL2Bytes",
    "data_type": "n",
    "meta_type": "bytes",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Request Packets",
    "name": "reqPkts",
    "data_type": "n",
    "meta_type": "packets",
    "description": ""
},
{
    "display_name": "Request RTO",
    "name": "reqRTO",
    "data_type": "n",
    "meta_type": "count",
    "description": ""
},
{
    "display_name": "Request Size",
    "name": "reqSize",
    "data_type": "n",
    "meta_type": "bytes",
    "description": ""
},
{
    "display_name": "Req Time To Last Byte",
    "name": "reqTimeToLastByte",
    "data_type": "n",
    "meta_type": "milliseconds",
    "description": ""
},
{
    "display_name": "Round Trip Time",
    "name": "roundTripTime",
    "data_type": "n",
    "meta_type": "milliseconds",
    "description": ""
},
{
    "display_name": "Response Bytes",
    "name": "rspBytes",
    "data_type": "n",
    "meta_type": "bytes",
    "description": ""
},
{
    "display_name": "Response L2 Bytes",
    "name": "rspL2Bytes",
    "data_type": "n",
    "meta_type": "bytes",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Response Packets",
    "name": "rspPkts",
    "data_type": "n",
    "meta_type": "packets",
    "description": ""
},
{
    "display_name": "Response RTO",
    "name": "rspRTO",
    "data_type": "n",
    "meta_type": "count",
    "description": ""
},
{
    "display_name": "Response Size",
    "name": "rspSize",
    "data_type": "n",
    "meta_type": "bytes",
    "description": ""
},
{
    "display_name": "Rsp Time To First Byte",
    "name": "rspTimeToFirstByte",
    "data_type": "n",
    "meta_type": "milliseconds",
    "description": ""
},
{
    "display_name": "Rsp Time To Last Byte",
    "name": "rspTimeToLastByte",
    "data_type": "n",
    "meta_type": "milliseconds",
    "description": ""
},
{
    "display_name": "Table",
    "name": "table",
    "data_type": "s",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "VLAN",
    "name": "vlan",
    "data_type": "n",
    "meta_type": "",
    "description": ""
},
{
    "display_name": "Application Name",
    "name": "appName",
    "data_type": "s",
    "meta_type": "",
    "default_visible": true,
    "description": ""
},
{
    "display_name": "Parameters",
    "name": "parameters",
    "data_type": "s",
    "meta_type": "",
    "default_visible": true,
    "description": ""
}
]