Unable to Extract Cluster Name via Regex for Node Field Update

Durgaprasad Joi
Tera Contributor
How can we configure an event rule that updates the Node field based on the Cluster Name extracted from the description below?

Example Description: nLUN Name: /vol/cc3_db_46/db46\nCluster Name: usw04sanc01 >#
We have already attempted to modify the regex expressions, but it did not work as expected. Screenshots are attached for reference.
2 REPLIES 2

sayali77sur
Tera Contributor
 

Hey there,

1. Navigate to Event Rules

  • Go to Event Management > Rules > Event Rules
  • Click New (or edit an existing event rule)

2. Event Filter: Select Relevant Events

  • Add condition to filter only events containing the Cluster Name, e.g.:
Field Operator Value
DescriptioncontainsCluster Name:

3. Transform & Compose: Extract Cluster Name with Regex

  • Add a regex extraction or parse action on the Description field
  • Use this regex pattern:

 

Cluster Name:\s*([^\s>]+) Note - ("capture every character until you hit a whitespace or >")

Store the first capture group into a temporary variable, e.g., tempClusterName

4. Binding Tab (Field Matching)

  • Set Binding Type to CI field matching (or your platform equivalent)

  • Clear Node field to prevent default/previous bindings:

    • Action:
      Set Node to "" (empty string)

5. Update Node Field

  • Add action:
    Set Node to ${tempClusterName} (i.e., assign the extracted cluster name to Node)

6. Activate & Save the Rule

Nishant8
Tera Sage

Hello @Durgaprasad Joi, Apparently, you forgot to attach the screenshot.

Regarding the event rule configuration, its an easy one to do as below

1. First and easiest one is inside the expression ( that uses pensil) and select the desired text (usw04sanc01  as per your example) and copy that to desired existing field or create new one, and assign that to Node

2. If specifically, you want Regex you can use the following one 

nLUN Name: \/vol\/cc3_db_46\/db46\nCluster Name: (.*?) >#

and store it into any variable let say cluster_name. Now, when you come out of RegEx edit mode, you can simply map cluster_name to Node field. Remember, there is a new line before "Cluster", so ensure that your Description field should have an "Enter meaning new line" accordingly.

 

please feel free to revert if you encounter any problem in configuring the above steps.

 

Regards,

Nishant