Skip to content
Documentation
Updated 4 minutes to read
Markdown

The RegEx plugin runs a regular expression on the message body of a Log Event and returns every whole match as a Search Field value. Use it when the matched text itself is the value you want, in XML, JSON, flat file, or any other text format.

  • ✅ Works on any text format in the message body
  • ✅ Returns every match, with duplicates collapsed
  • ✅ Returns the whole match, even when the pattern contains capturing groups

Four RegEx plugins cover the combinations of where the text is and what part of the match you want. For every plugin, see Choose a plugin.

Your data You want Use
Message body The whole match RegEx (this page)
Message body Only the part inside a capturing group ( ) RegEx with capturing groups
One context value (you know the key) The whole match RegEx on Message Context
One context value (you know the key) Only the part inside a capturing group RegEx on Message Context with capturing groups
One context value (you know the key) The value as it is, no pattern Message Context Key
XML body, pattern on a selected node only The match within that node XPath with RegEx
A match you need to transform or combine Nested functions Formula with regex or regexGroup

Select RegEx in the Type list and enter the pattern in the Expression field. The plugin has no other settings.

Type list filtered on regex, with RegEx selected (7.12)
The RegEx plugin and its siblings in the Type list.

  • The plugin returns every match in the message body; Search Fields keep unique values only (see How expressions run).
  • The result is always the whole match. Parentheses in the pattern don't change that: CityId="([0-9]+)" returns CityId="054", not 054. To return only the group, use RegEx with capturing groups.
  • Matching ignores case: the pattern cityId matches CityId in Example 1.
  • Spaces in the pattern are ignored, and # starts a comment: a b matches ab, not a b. Write a literal space as \s or [ ], and a literal # as \#. The info line under Type ends with the same rule: "The pattern ignores case and white space: write a space as \s or [ ] and # as \# (an unescaped # starts a comment)."
  • Each value is trimmed of leading and trailing white space, and an empty match is dropped.
  • A pattern may run for 30 seconds per event at most.
  • When nothing matches, Test Expression reports Processed with warning: The Expression yields no result.

Expressions tab with Type RegEx and the info line under Type, which ends with the rule for spaces and the hash sign (7.12)
The RegEx plugin's fields and info line.

Test Expression result: Processed with warning, The Expression yields no result (7.12)
Test result when the pattern matches nothing in the message body.

RegEx with capturing groups on the ORD-10009 order confirmation returns only the mail domain, animated walkthrough (7.12)
Animated walkthrough: the sibling plugin RegEx with capturing groups returns only group 1 (northwind.example.com); the RegEx plugin would return the whole address orders@northwind.example.com.

Configure and test the expression as described in Add or manage Search Field and Test Your Expression.

Example 1: Extract city attributes from an order message

Section titled “Example 1: Extract city attributes from an order message”
<ns0:Orders xmlns:ns0="Common.Schemas/Nodinite/1.0">
<Order>
<Id>101</Id>
<Amount>1337</Amount>
<City CityId="054">Karlstad</City>
</Order>
<Order>
<Id>102</Id>
<Amount>10</Amount>
<City CityId="08">Stockholm</City>
</Order>
</ns0:Orders>
cityId="([0-9]+)"
CityId="054"
CityId="08"

The pattern contains a capturing group, but the RegEx plugin still returns the whole match. To get 054 and 08, use the same pattern with RegEx with capturing groups.

Test Expression for the RegEx plugin returning two whole CityId matches from an Orders XML message (7.12)
Test Expression: two unique whole matches from the Orders message. The first City line is blurred in the screenshot; it is the same as in the input above.

Example 2: Extract invoice numbers from a JSON message

Section titled “Example 2: Extract invoice numbers from a JSON message”
{
"invoices": [
{ "invoiceNo": "INV-2026-0042", "amount": 1250.00 },
{ "invoiceNo": "INV-2026-0043", "amount": 89.50 }
]
}
INV-\d{4}-\d{4}
INV-2026-0042
INV-2026-0043

The pattern describes the whole value, so the whole match is exactly the invoice number.

RegEx test: a pattern for INV- followed by two groups of four digits, on a JSON invoice message, returns two invoice numbers (7.12)
The pattern matches each invoiceNo value in the JSON body.

...

Version:
Release date: N/A
Loading...

Explore Nodinite for 30 days – completely free

  • Find out why this is the leading O&M software
  • Prove your business case
  • Test the self-service for the business side

Loading...

See how Nodinite resolves your technical issues, in a LIVE Demo!

Once you submit this request:

  • We will give you a short call to understand the issues you want to tackle.
  • Understand solutions you have tried and why were you not happy with them.
  • Book a convenient slot for a LIVE demo!

Loading...