I am trying to pull below 3 values from tag of dynatrace with regex and tried :
} else {
//Regex to find CFU, Environment & Snowappid from tags
var add_info_parser = JSON.parse(requestBody);
var regex_match = new RegExp(/^(?=.*Environment:\s*(\w+))(?=.*CFU:\s*(\w+))(?=.*SnowAppID:\s*(\w+)).*/igm);
var tags = add_info_parser.Tags;
gs.info("Dynatarce before regex match" + tags);
regex_match = regex_match.exec(tags);
gs.info("Dynatrace regex value" + regex_match);
appIdTag = regex_match[3].toString();
environmentTag = regex_match[1].toString();
var CFU_value = regex_match[2].toString().toLowerCase();
if (cfuOverride.indexOf(CFU_value) > -1) {
overrideBinding = true;
}
unfortunately not worked.
Can anybody help with Standard JavaScript regular expressions to match from below tags:
- SnowAppID:APP12130
- Environment: PROD
- CFU: Consumer
From this line. I need to use push connector which run on javascript.
"EnterpriseCloud, Environment:PROD, Data Centre:London, ServiceNow-Integrated:True, CFU:Consumer, SnowAppID:APP12130, Application:KCIM"
Via Active questions tagged javascript - Stack Overflow https://ift.tt/NAEJMCL
Comments
Post a Comment