Message Context Key Search Field Expression Plugin
Easily extract unique values from named context properties using the Message Context Key Search Field Expression Plugin. This page shows you how to configure, test, and use this plugin with clear input, configuration, and result examples.
✅ Extract a unique value from any named context property ✅ Simple configuration for fast results ✅ Works with HTTP headers, BizTalk context properties, and custom metadata ✅ Designed for high performance and self-service log views
🎯 Design Note: Perfect for extracting metadata like correlation IDs, HTTP headers, or BizTalk promoted properties!
What does the Message Context Key plugin do?
The Message Context Key plugin lets you extract a unique value from a named context property in Log Events. Use it to target specific metadata like HTTP headers, BizTalk context properties, or custom promoted properties.
Key Features:
- Extract a single value from a named context property
- Simple key-based lookup
- Works with any context property type
- Ideal for correlation IDs, tracking numbers, and metadata
Use Case: Extract metadata values like
CorrelationId
,ContentType
, orBTS.MessageType
from message context properties.
How it works
The Message Context Key plugin processes messages in three steps:
- Input: The message context properties (metadata)
- Context Key: The name of the property to extract
- Result: The value of the specified property
The plugin looks up the specified context property and returns its value.
Example
Context Property Name:
ProductOfTheYear
Property Value:
Nodinite
Result:
Nodinite
Example: Key-value properties from message context.
Tip
Common context properties include
CorrelationId
,ContentType
,BTS.MessageType
, or custom HTTP headers.
Example: Valid expression with state output, unique value, and total count.
Common context properties
Property Type | Example Key | Description |
---|---|---|
Correlation | CorrelationId |
Unique identifier for message tracking |
HTTP Header | ContentType |
Content type of the HTTP request |
BizTalk Context | BTS.MessageType |
BizTalk message type |
Custom Property | OrderNumber |
Custom promoted property |
How to use the Message Context Key plugin
- Open the Search Field Wizard from a Log View and either create a new Search Field or edit an existing one
- Choose the Message Context Key plugin from the Expression Type dropdown
- Enter the name of the context property to extract
- Select the Message Type(s) to apply the field
- Save the configuration
- Re-index existing data (optional)
- The extracted data is now available in your Log Views!
Example: Selecting the Message Context Key plugin in the Search Field configuration.
Tip
Extracted values are stored for as long as the Message Type retention is configured.
Testing your expression
You can test your configuration in the Test Expression tab before saving:
- Enter a sample payload in the Message Body tab
- Select the Message Context Key plugin
- Enter the name of the context property to extract
- Review the output and adjust as needed
Successful Match: ✅ Shows matched value and extraction count.
Example: Valid expression with state output, unique value, and total count.
No Match: ❌ Occurs when the property name doesn't exist in the message context.
Example: Property name not found in message context.
Related plugins
- RegEx on Message Context - Apply RegEx patterns to message context properties
- RegEx On Message Context with capturing groups - Extract specific parts from context values
- XPath on Message Context - Use XPath on context properties containing XML
- Formula - Create expressions with conditional logic
Next steps
Related topics
- What are Search Fields?
- What are Search Field Expressions?
- What are Message Types?
- What are Log Views?