---
title: "Search Field Expressions: How They Run and Which Plugin to Choose | Nodinite"
description: Search Field Expressions extract values from the body or context of logged messages in XML, JSON, EDI, CSV, and flat files. Learn how expressions run and which plugin to choose for your data.
---

# <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> What are Search Field Expressions?

A **Search Field Expression** tells <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> *how* to extract a value from a logged message. The [Search Field][Search Fields] is *what* users search for, such as "Order Number"; its expressions extract that value from each [Message Type][Message Types], whatever the format.

* ✅ Extract the same business value from XML, JSON, EDI, CSV, and flat files  
* ✅ Read from the message body or from context properties  
* ✅ Test against real logged messages before you save  

![JSON Path expression tested on a logged Order Received event, animated walkthrough (7.12)][1]  
*Animated walkthrough: in **Edit Search Field Expressions**, pick the [JSON Path][JSON Path] type, enter the order id path, and test it on a logged Order Received event; the **Result** shows ORD-10010.*  

An **Order Number** can arrive as XML from SAP, as EDI from a supplier, and as JSON from a web shop. Give the "Order Number" Search Field one expression per [Message Type][Message Types], and users find every message for an order with one search, end-to-end.

```mermaid
graph LR
    subgraph Flow["fa:fa-route Order flow: one Log Event per step"]
        M1["fa:fa-file-code Order Request<br/>XML"]
        M2["fa:fa-file-lines Order Confirmation<br/>EDI"]
        M3["fa:fa-key Order Delivery<br/>context properties"]
        M4["fa:fa-table Payment<br/>fixed-width flat file"]
        M5["fa:fa-file-code Payment Confirmation<br/>JSON"]
    end
    M1 -->|"XPath"| SF["fa:fa-magnifying-glass-plus Search Field<br/>Order Number"]
    M2 -->|"RegEx"| SF
    M3 -->|"Message Context Key"| SF
    M4 -->|"Flat file Fixed width"| SF
    M5 -->|"JSON Path"| SF
    SF --> LV["fa:fa-hard-drive Log View<br/>one search, every step"]
    style M1 fill:#2678BD,color:#fff
    style M2 fill:#2678BD,color:#fff
    style M3 fill:#2678BD,color:#fff
    style M4 fill:#2678BD,color:#fff
    style M5 fill:#2678BD,color:#fff
    style SF fill:#E47528,color:#fff
    style LV fill:#93d16d,color:#000
```

*Diagram: each step of the order flow logs a different message format (blue); one expression per Message Type, labelled on the arrow, extracts the same value into the "Order Number" Search Field (orange), so one search in a [Log View][Log Views] (green) finds every step.*

---

## <i class="fal fa-gears" aria-hidden="true"></i> How expressions run

```mermaid
graph LR
    A["Log Event<br/>logged"] --> B{"Message Type"}
    B --> C["Search Field Expressions<br/>for this Message Type"]
    C --> D["Extracted values"]
    D --> E["Search Field values<br/>in Log Views"]
    style A fill:#2678BD,color:#fff
    style B fill:#FFD525,color:#000
    style C fill:#E47528,color:#fff
    style D fill:#3F827B,color:#fff
    style E fill:#93d16d,color:#000
```

*Diagram: the [Logging Service][] selects the expressions for the [Log Event][]'s Message Type and stores the extracted values on the Search Fields.*

1. A [Log Event][] is logged, or re-indexed, and the [Logging Service][] identifies its [Message Type][Message Types]. For EDIFACT messages, the [EDIMessageTypeParseString][] [System Parameter][System Parameters] builds the Message Type name.
2. Every Search Field Expression configured for that Message Type, or as **Global**, runs against the Log Event.
3. The extracted values are stored on the [Search Field][Search Fields] and can be searched in [Log Views][].

What you need to know about every expression, whatever the plugin:

|Topic|Behavior|  
|---|---|  
|**Data source**|An expression reads the message body (payload) or the context properties (key/value metadata such as headers and tracked properties). The [Formula][] plugin can read both, plus Log Event fields, and look up values in SQL Server.|  
|**Message Types**|Each expression applies to the [Message Types][] you select on it. One Search Field typically has one expression per Message Type.|  
|**Global**|A Global expression runs for every Message Type. Use it sparingly: it runs for every logged message.|  
|**Optional**|When checked, finding no value is normal. When unchecked, finding no value is reported as a warning.|  
|**Several values**|An expression can return several values, such as every order number in a batch file. All of them are searchable.|  
|**Unique values**|Duplicates are collapsed. The test bench shows the **Number of unique matches**.|  
|**History**|New expressions apply to new Log Events. [Re-index][Add or manage Search Field - How a Re-Index Runs] to apply them to Log Events already logged.|
|**Large bodies**|A message body larger than the [MessageProcessingMaxBodySize][] System Parameter isn't processed, so body-based expressions extract nothing from it.|
|**Filtered context**|Context properties that the [ContextPropertiesFilters][] System Parameter removes aren't kept, so don't base context-based expressions on them.|
|**Encoding**|The body is read in its resolved [Character Encoding][], the same encoding the wizard's Test step shows.|  

Set these properties and test your expression on [Add or manage Search Field][]; see [Test Your Expression][].

---

## <i class="fal fa-signs-post" aria-hidden="true"></i> Choose a plugin

Pick the plugin by where the value is and what the data looks like. Each plugin page has syntax and worked examples. The table is ordered by use case; the **Type** list in the editor sorts the plugins A–Z by name.

|Your value is in…|Use|  
|---|---|  
|XML in the body|[XPath][]|  
|XML in the body, but you need only part of the selected text|[XPath with RegEx][]|  
|XML that is encoded inside another XML element|[XPath on wrapped XPath][XPath on Wrapped XPath]|  
|XML stored in a context property|[XPath on Message Context][]|  
|JSON in the body|[JSON Path][]|  
|JSON in the body, with a Base64-encoded part that holds JSON|**JSON Path Base64 Decode with JSON Path** (no page of its own yet; the [base64decode][] Formula function does the same)|  
|JSON in the body, with a Base64-encoded part that holds XML|**JSON Path Base64 Decode with XPath** (no page of its own yet; the [base64decode][] Formula function does the same)|  
|Any text in the body (EDI, plain text, any format) — the whole match|[RegEx][]|  
|Any text in the body — only part of the match|[RegEx with capturing groups][]|  
|A context property you know the exact key of|[Message Context Key][]|  
|A context property value — the whole match of a pattern|[RegEx on Message Context][]|  
|A context property value — only part of the match|[RegEx on Message Context with capturing groups][]|  
|Delimited text (CSV, semicolon, pipe)|[Flat file CSV][Flat File CSV]|  
|Fixed-width records|[Flat file Fixed width][Flat File Fixed Width]|  
|Needs combining, transforming, counting, or a SQL lookup|[Formula][]|  

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>Prefer the simplest plugin that does the job: a dedicated plugin is easier to read and faster than the same logic in a <a href="https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/">Formula</a>.</p></div>
</aside>

![Type list in the Edit Search Field Expressions dialog, plugins sorted A to Z (7.12)][2]  
*The **Type** list when you add a Search Field Expression, sorted A–Z by name; it scrolls on past the first ten plugins.*  

---

## <i class="fal fa-lightbulb" aria-hidden="true"></i> Best Practices

* Name Search Fields in business terms ("Order Number") and keep the technical detail in the expressions.
* Select specific [Message Types][] instead of Global whenever you can.
* Test every expression with real messages, including edge cases such as missing or empty values, and mark it **Optional** when the value may legitimately be absent.
* Keep [Formula][] expressions short; split complex logic over several Search Fields if it gets hard to read.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Field][]  
* <i class="fal fa-wand-magic-sparkles" aria-hidden="true"></i> [How to use the Search Field Wizard][Search Field Wizard]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log Views][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Search Fields][]  
* <i class="fal fa-list" aria-hidden="true"></i> [Search Fields Overview][]  
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][]  
* <i class="fal fa-code" aria-hidden="true"></i> [Allowed XPath expressions][]  
* <i class="fal fa-file" aria-hidden="true"></i> [Message Types][]  
* <i class="fal fa-file-lines" aria-hidden="true"></i> [EDIMessageTypeParseString][]  
* <i class="fal fa-weight-hanging" aria-hidden="true"></i> [MessageProcessingMaxBodySize][]  
* <i class="fal fa-filter" aria-hidden="true"></i> [ContextPropertiesFilters][]  
* <i class="fal fa-language" aria-hidden="true"></i> [Character Encoding][]  
* <i class="fal fa-search" aria-hidden="true"></i> [Log Views][]  
* <i class="fal fa-cogs" aria-hidden="true"></i> [Logging Service][]  
* <i class="fal fa-receipt" aria-hidden="true"></i> [Find an order by Order Id][] - How business users search on a Search Field  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Expression_JsonPath.gif
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/ExpressionTypes.png

[Add or manage Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[Add or manage Search Field - How a Re-Index Runs]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#how-a-re-index-runs
[Allowed XPath expressions]:https://docs.nodinite.com/administration/log-management/search-fields/troubleshooting/allowed-xpath-expressions/
[base64decode]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/convert/base64decode/
[Character Encoding]:https://docs.nodinite.com/core-services/log-event/features/character-encoding/
[ContextPropertiesFilters]:https://docs.nodinite.com/administration/settings/system-parameters/contextpropertiesfilters/
[EDIMessageTypeParseString]:https://docs.nodinite.com/administration/settings/system-parameters/edimessagetypeparsestring/
[Find an order by Order Id]:https://docs.nodinite.com/getting-started/scenarios/order-flow/find-an-order-by-order-id/
[Flat File CSV]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/flat-file-csv/
[Flat File Fixed Width]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/flat-file-fixed-width/
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[JSON Path]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/json-path/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Message Context Key]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/message-context-key/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[MessageProcessingMaxBodySize]:https://docs.nodinite.com/administration/settings/system-parameters/messageprocessingmaxbodysize/
[RegEx]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/regex/
[RegEx on Message Context]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/regex-on-message-context/
[RegEx on Message Context with capturing groups]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/regex-on-message-context-with-capturing-groups/
[RegEx with capturing groups]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/regex-with-capturing-groups/
[Search Field Wizard]:https://docs.nodinite.com/administration/log-management/search-fields/getting-started/how-to-use-the-search-field-wizard/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Search Fields Overview]:https://docs.nodinite.com/administration/log-management/search-fields/overview/
[System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/overview/
[Test Your Expression]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#test-your-expression
[XPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/xpath/
[XPath on Message Context]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/xpath-on-message-context/
[XPath on Wrapped XPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/xpath-on-wrapped-xpath/
[XPath with RegEx]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/xpath-with-regex/