- 3 minutes to read

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, or BTS.MessageType from message context properties.


How it works

The Message Context Key plugin processes messages in three steps:

  1. Input: The message context properties (metadata)
  2. Context Key: The name of the property to extract
  3. Result: The value of the specified property
graph LR A["Input: Message Context"] --> B["Context Key Name"] B --> C["Result: Property Value"]

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.

Test Expression 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

  1. Open the Search Field Wizard from a Log View and either create a new Search Field or edit an existing one
  2. Choose the Message Context Key plugin from the Expression Type dropdown
  3. Enter the name of the context property to extract
  4. Select the Message Type(s) to apply the field
  5. Save the configuration
  6. Re-index existing data (optional)
  7. The extracted data is now available in your Log Views!

Select Message Context Key plugin 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:

  1. Enter a sample payload in the Message Body tab
  2. Select the Message Context Key plugin
  3. Enter the name of the context property to extract
  4. Review the output and adjust as needed

Successful Match: ✅ Shows matched value and extraction count.

Test Expression 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.

No Result Example: Property name not found in message context.



Next steps