Skip to content
Documentation
Updated 2 minutes to read
Markdown

The body Formula function returns the whole message body (payload) of the Log Event as text.

Read the whole message body of an Order-to-Cash event with body, then pick the customer name out of it with xPath, animated walkthrough (7.12)
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.

body
Parameter Required Description
(none) – body takes no parameters and is written without parentheses.

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).

<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>
body
<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>

Test Expression tab: body returns the whole XML order as one unique match (7.12)
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.

xpath('Orders/Order/City', body)
New York

Test Expression tab: xpath('Orders/Order/City', body) returns New York (7.12)
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; write body.
  • 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 body is 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.

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...