Formula - Body
Section titled “ Formula - Body”The body Formula function returns the whole message body (payload) of the Log Event as text.

Animated walkthrough: on the logged XML Order Entry of order ORD-10005 in the Order-to-Cash demo, body returns the complete payload as one value, and xPath('OrderEntry/Customer/CustomerName', body) returns Tailspin Toys.
Syntax
Section titled “ Syntax”bodyParameters
Section titled “Parameters”| Parameter | Required | Description |
|---|---|---|
| (none) | – | body takes no parameters and is written without parentheses. |
Returns
Section titled “Returns”The complete message body as one text value. Use body as the Content argument of another function, such as xPath, jsonPath, or regex, to pick values out of the payload (see Formula language rules).
Examples
Section titled “ Examples”Example 1: Return the whole XML order
Section titled “Example 1: Return the whole XML order”<ns0:Orders xmlns:ns0="SupplyChain.Schemas/1.0"> <Order> <Id>1337</Id> <Amount>666</Amount> <City>New York</City> <Partner>QWNtZQ==</Partner> </Order></ns0:Orders>Formula
Section titled “Formula”bodyResult
Section titled “Result”<ns0:Orders xmlns:ns0="SupplyChain.Schemas/1.0"> <Order> <Id>1337</Id> <Amount>666</Amount> <City>New York</City> <Partner>QWNtZQ==</Partner> </Order></ns0:Orders>
The body formula returns the complete message body as one unique match.
Example 2: Use the body as content for xPath
Section titled “Example 2: Use the body as content for xPath”The same XML order as in Example 1.
Formula
Section titled “Formula”xpath('Orders/Order/City', body)Result
Section titled “Result”New York
body hands the whole payload to xpath, which returns the one City value; the ns0 prefix needs no namespace declaration in the path.
body()with parentheses is not the documented form; writebody.- Functions that parse the whole message body, such as xPath or regex, take longer on large payloads; keep the formula as specific as the job allows.
- The Logging Service decodes the body with its resolved Character Encoding (Log Event, Endpoint, or Message Type) before any Search Field Expression runs, so
bodyis already text in the right characters. A body logged as base64 can be decoded there with a Base64 Decode into … encoding, or in the formula with base64decode.