Convert Audit Record to XML Assertion
The Convert Audit Record to XML assertion converts the current audit record into XML code as an in-memory DOM tree, overwriting the targeted message.
gateway83
The
Convert Audit Record to XML
assertion converts the current audit record into XML code as an in-memory DOM tree, overwriting the targeted message.This assertion is designed to populate the request in an audit sink policy with some XML. The resulting XML is not enclosed in a SOAP envelope.
To learn about selecting the target message for this assertion, see Select a Target Message.
The Convert Audit Record to XML assertion works only within an audit sink policy. It has no effect when placed in any other policy (for example, in the main service policy).
Using the Assertion
- Add the assertion to an audit sink policy as described in Add an Assertion.
The assertion is added to the policy window; no further configuration is required.
Contents:
Code Samples
The following are examples of XML code that are created for each type of audit record:
System Audits
<audit action="Checking" componentId="1290010" id="0" level="800" levelStr="INFO" name="Trusted Certificate Store" sequenceNumber="4" type="system" xmlns="http://l7tech.com/audit/rec"> <nodeId>node1</nodeId> <time>1253670817171</time> <message>One or more trusted certificates has expired or is expiring soon</message> <ipAddress>192.168.1.42</ipAddress> <thrown>java.lang.RuntimeException: main record throwable (rest of stack trace)</thrown> </audit>
Message Summary Audits
<audit type="message" id="0" level="800" levelStr="INFO" name="ACMEWarehouse" sequenceNumber="2" xmlns="http://l7tech.com/audit/rec"> <nodeId>node1</nodeId> <requestId>req4545</requestId> <time>1253669933078</time> <message>Message processed successfully</message> <ipAddress>3.2.1.1</ipAddress> <user id="41123" identityProviderGoid="-2" name="alice"/> <details> <detail componentId="0" messageId="6" ordinal="0" time="1253669933078"> <params> <param>foomp</param> </params> <exception>java.lang.IllegalArgumentException: Exception for foomp detail (rest of stack trace)</exception> </detail> </details> <thrown>java.lang.RuntimeException: main record throwable (rest of stack trace)</thrown> <authType>HTTP Basic</authType> <mappingValuesOid>49585</mappingValuesOid> <operationName>listProducts</operationName> <requestContentLength>4833</requestContentLength> <requestSavedFlag>false</requestSavedFlag> <responseContentLength>9483</responseContentLength> <responseSavedFlag>false</responseSavedFlag> <responseHttpStatus>200</responseHttpStatus> <routingLatency>232</routingLatency> <serviceOid>8859</serviceOid> <status>0</status> </audit>
Administrative Audits
<audit type="admin" action="U" id="0" level="800" levelStr="INFO" name="testuser" sequenceNumber="0" xmlns="http://l7tech.com/audit/rec"> <nodeId>node1</nodeId> <requestId>0000000000000003-22b</requestId> <time>1253669933046</time> <message>updated</message> <ipAddress>2.3.4.5</ipAddress> <user id="1111" identityProviderGoid="-1" name="admin"/> <details> <detail componentId="0" messageId="6" ordinal="0" time="1253669933046"> <params> <param>foomp</param> </params> <exception>java.lang.IllegalArgumentException: Exception for foomp detail (rest of stack trace)</exception> </detail> </details> <thrown>java.lang.RuntimeException: main record throwable (rest of stack trace)</thrown> <entity class="com.l7tech.identity.User" goid="1234"/> </audit>
How Audits are Converted to XML
The Gateway converts the audits to XML using the schema described in the attached auditschema.xsd.