XPath on Message Context search field expression type plugin
Easily extract unique values from XML content within context properties using the Nodinite XPath on Message Context Search Field Expression Plugin. This page shows you how to configure, test, and use this plugin with clear input, configuration, and result examples.
✅ Extract single or multiple unique values from XML content in context properties
✅ Use high-performance streaming XPath extraction for large messages
✅ Designed for high performance and self-service log views
What is the XPath on Message Context Plugin?
The Nodinite XPath on Message Context plugin lets you extract one or more unique values from XML content (elements and attributes) in context properties of Log Events. Use it to process messages where you need to target specific XML data within a context property.
- Extract XML content from named context properties
- Use XPath expressions as defined by W3C
- High-performance streaming reader supports large XML documents
Use this plugin for extracting values from XML content in context properties using XPath.
How It Works: Input → Context Property → XPath Expression → Result
Each example below clearly separates the Input (XML content), the Context Property (property name), the XPath Expression (pattern), and the Result (output value).
Quick Example
Input:
<ns0:Orders xmlns:ns0="Common.Schemas/Nodinite/1.0">
<Order>
<Id>101</Id>
<Amount>1000</Amount>
<City>Karlstad</City>
</Order>
<Order>
<Id>102</Id>
<Amount>10</Amount>
<City>Stockholm</City>
</Order>
</ns0:Orders>
Context Property:
XMLContent
XPath Expression:
Orders/Order/Id
Result:
101
102
Examples
Example 1: Extract Order IDs from XML Content in Context Property
Input:
<ns0:Orders xmlns:ns0="Common.Schemas/Nodinite/1.0">
<Order>
<Id>101</Id>
<Amount>1000</Amount>
<City>Karlstad</City>
</Order>
<Order>
<Id>102</Id>
<Amount>10</Amount>
<City>Stockholm</City>
</Order>
</ns0:Orders>
Context Property:
XMLContent
XPath Expression:
Orders/Order/Id
Result:
101
102
Valid expression with state output, unique values, and total count.
Features
- Extract XML content from named context properties
- Use XPath expressions for advanced extraction
- High-performance streaming reader supports large XML documents
- Designed for small and large payloads
Note: This plugin uses a high-performance, read-only, fast-forward-only stream reader. Not all types of XPaths can be evaluated due to the forward-only nature.
How to Use
- Select the 'XPath on Message Context' expression type plugin when configuring a Search Field.
- Enter the name of the context property to extract the XML content from.
- Enter the XPath expression to extract the desired value(s).
- Finalize the configuration and select the Message Types to apply the expression.
- Optionally, perform a re-index operation (Add or manage Search Field).
Extracted values are stored for as long as the Message Type retention is configured.
Test Expression
You can test your configuration in the 'Test Expression' tab when setting up a Search Field:
- Enter a sample payload in the 'Message Body' tab
- Select the 'XPath on Message Context' plugin
Here's an example selecting the 'XPath on Message Context' expression type plugin. - Enter the name of the context property and the XPath expression
- Review the output and adjust as needed
If the expression is valid, you will see the unique values and total count:
Valid expression with state output, unique values, and total count.
If the expression is invalid or does not match any data, you will see:
Example of an invalid expression yielding no result.
Related Plugins and Topics
- RegEx
- RegEx with capturing groups
- RegEx on Message Context
- RegEx on Message Context with capturing groups
- XPath with RegEx
- Formula – For advanced options using nested expressions
Mermaid Diagram: Search Field Expression Flow
This diagram shows how the XPath on Message Context plugin fits into the overall search field expression process.
Next Step
Learn More
- What are Search Fields?
- What are Search Field Expressions?
- What are Message Types?
- What are Log Views?