- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 06:17 AM
I need to write the regex to extract yeasdtsa i.e present in the InstanceGroup, please help me with that
Reason: UsedPercent >= 47 65 85
error - agsfuwn34282.hitchi.net TableSpace Usage maximum table space growth
Host: agsfuwn34282.hitchi.net
Datasource: TableSpace Usage maximum table space growth
InstanceGroup: yeasdtsa.hitchi.net
Datapoint: UsedPercent
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 06:36 AM
Hello @Ankitha4 ,
Regular expression " /InstanceGroup: (\w+)/" should print you the required value.
If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 06:36 AM
Hello @Ankitha4 ,
Regular expression " /InstanceGroup: (\w+)/" should print you the required value.
If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 06:27 AM
Hi Shubham , thanks for the reply . The regex is working when I tried in regex101 but when I tried this regex to extract the same value in event rule . It is not working . Can you please help me with this issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 06:48 AM
const regex = /(?<=InstanceGroup:\s)[^.]+/;
const match = text.match(regex);
if (match) { console.log(match[0]); // Output: yeasdtsa
} else {
console.log('No match found');
}
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark