Regex / Pattern in NAS AO Profile not matching alarm for message string
search cancel

Regex / Pattern in NAS AO Profile not matching alarm for message string

book

Article ID: 368162

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

We have defined an expression in a Auto-Operator file in the nas to match a particular message, however, the match is not occurring. 

Scenario:

We want to match any alarm where the word "DNS" exist in the message string. 

 

Example alarm message: "server example DNS has crossed the thresholds xxxYYY"

Example string used: .*DNS.*

 

Why is it not matching? 

Environment

DX UIM 20.4.* / 23.4.* 

Cause

Wrong Regex / Pattern matching. The expression .*DNS.* is not matching the message string because even though the work DNS is present because Regex needs to be enclosed into "/" Example: /<regular_expression>/  or else, use Pattern matching which requires a different matching pattern. 

Resolution

To march any message string with the word 'URL' inside use either: 

 

*DNS*

or

/.*DNS.*/

 

The first one will use pattern matching, the second one will use Regex. Both will match. 

 

Additional Information