Unable to Extract Cluster Name via Regex for Node Field Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.:
| Description | contains | Cluster Name: |
3. Transform & Compose: Extract Cluster Name with Regex
- Add a regex extraction or parse action on the Description field
- Use this regex pattern:
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)
- Action:
5. Update Node Field
- Add action:
Set Node to ${tempClusterName} (i.e., assign the extracted cluster name to Node)
6. Activate & Save the Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks @Nishant8 and @sayali77sur
We are now bringing the Node through Event Filed Mapping as expression did not help. It works as expected in updating Node. However, CI binding is not happening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Durgaprasad Joi, Event mapping applies after event rule and depends on whether 'Run after binding' is checked or not as well. I'd recommend to map Node in the Event Rule. I've prepared a simple Rule to help you map the Node and attached herewith. Please import and let me know the outcome.
Regarding the CI binding, it subjects to following couple of points:
- If your Node name is Hardware class CI then attached Rule will work as default binding help CI bind.
- If Node is non Hardware device, then you will have to override the CI binding. you can try at your end or else let me know, I can help you write this.
Regards,
Nishant