- 3 minutes to read

RegEx on Message Context search field expression type plugin

Use this plugin to extract values from a named Context property using a RegEx expression.

The Nodinite RegEx on Message Context Search Field Expression Type plugin can be used to find one or more unique values from Context Properties for logged messages.

A Logged message comes from a Log Event that is part of the Logging feature of Nodinite, and the Search Fields are further used within self-service enabled Log Views for your business.

Quick example

Let's get you started with the following simple demonstration example valid for this search field plugin. For other and more advanced examples please scroll down on this page to the Examples section.

Input 1st Expression 2nd Expression Result
\\nodinitesrv01\ftp\public\INT001\Order\OrderFile_123.xml
FileName
([^\\]+$)
OrderFile_123.xml
XML Data within named Context Property 'FileName' 1st Named Context Property 2nd XPath expression Unique values

Features

  • Extract single or multiple unique values from named Context property
  • Use any RegEx expression to match and/or style data

Important

This plugin loads the entire message into RAM, so make sure to apply this extraction method on smaller messages only.


How to use

To extract values from Context Properties you must first configure the Search Field, in this example case; The File name part:

  • Select expression type plugin
  • Enter 1st expression to get the content from named Context property
  • Enter 2nd expression to match/style the content from previous expression
  • Finalize remaining steps including selection of Message Types and optional re-index operation (Add or manage Search Field)

Once a Search Field is configured, values are extracted either during normal processing or from user initiated re-index operations. Extracted values are persisted and stored for as long as the days to keep events property on the Message Type is configured.

Test Expression

You can test an expression when configuring a Search Field in the 'Test Expression' tab

  1. Enter an appropriate payload in the 'Message Body' tab
  2. Select the 'RegEx on Message Context' expression type plugin
    Select
  3. Enter 1st Context property expression to get the content
  4. Enter 2nd RegEx expression to match/style the content from returned by step 3
  5. Review result/output, rewrite the code in step 3-4 until you get the data you seek

The actual result (values) are extracted by the Logging Service and then presented together with the evaluated processing state and the number of unique matches.

Test Expression
Valid expression with state output, unique values and total count

If the expression is either invalid or does not match any data, then the following output is presented:
No Result
Here's an example with an invalid expression, which yields no result.

Examples

graph LR subgraph "Search Fields" sf(fal:fa-magnifying-glass-plus Order Number) end subgraph "Search Field Expressions" sfe(fal:fa-flask RegEx on Message Context plugin) end subgraph "MessageTypes" mt1(fal:fa-file Orders) end sf --- sfe sfe ---|Expression| mt1

Basic example

To extract order id(s) for the Message Type 'Common.Schemas/Nodinite/1.0#Orders' you can use the following named Context property 'FileName' and then the valid RegEx expression '([^\\]+$)'. This configuration yields the unique values OrderFile_123.xml.

FileName Context property

\\nodinitesrv01\ftp\public\INT001\Order\OrderFile_123.xml

1st Expression

FileName

2nd Expression

([^\\]+$)

Next Step

How to Add or manage Search Fields
How to Add or manage Log Views

Expression Type Plugins are used in Search Fields
What are Search Fields?
What are Search Field Expressions?
What are Message Types?
What are Log Views?