Test Regex in Edge Delta

Build and test regex patterns for use in your pipeline nodes.

Overview

Regex patterns can be difficult to write due to differences in regex flavors. For example, Edge Delta uses Golang regexp, which might not perfectly recognize patterns developed for Perl Compatible Regular Expressions (PCRE). To assist with this, you can select out of the box patterns for common use cases. You can also use the Regex tester in the node testing pane to develop and test regex patterns against actual log samples.

Use Out of the Box Patterns

  1. Click Edit Mode.
  2. Create the node that performs the function you want using regex, for example click Add Processor, expand Filters and select Regex Filter.
  3. Select a common regex pattern from the list in the Regex Suggestions section:

Write and Test Regex Patterns Using the Regex Assistant

To start you should collect a log sample that is representative of those emitted by your environment.

  1. Click Edit Mode.
  2. Create the node that performs the function you want using regex, for example click Add Processor, expand Filters and select Regex Filter.
  3. Paste the sample log in the Samples pane.
  4. Select the portion that you want to capture and select Generate Regex Pattern.
  1. A suggested pattern is added to the Pattern field.
  2. Test the pattern by clicking Process Samples.

Write and Test Regex Patterns Using the Regex Library

To start you should collect a log sample that is representative of those emitted by your environment.

  1. Click Edit Mode.
  2. Create the node that performs the function you want using regex, for example click Add Processor, expand Filters and select Regex Filter.
  3. Paste your sample logs in the Samples field.
  4. Click Open Regex Library.
  5. You can select the out of the box patterns and view log samples designed to illustrate their function. Alternatively click Custom Logs to use your sample logs, then write your custom regex pattern in the Regular Expression field.

LLMs can assist in writing regex patterns but they need to be confirmed against the Golang Regexp flavor in the Edge Delta Regex tester.

The Matches pane highlights the parts of your log samples that are matched by the pattern.

  1. Click Apply Regex.

For more information on node testing see Designing Pipelines and Testing Nodes.

See Also: