15 Mar 2021 08:17 PM
Hi community, I wrote the following Regex to match either hostname formats:
(?:ocp-p[a-zA-Z]-a\d{0,2}|worker-\d{0,2}\.ocp4-re)\.cloud\.com |
The hostname are dynamically created.
I've check the rule on Regex 101 and matches everything as expected, but when I go to Dynatrace and hit preview only matches example 1 and 4. What I'm doing wrong?
worker-10.ocp4-re.cloud.com
ocp-pe-a2.cloud.com
ocp-pe-a42.cloud.com
worker-0.ocp4-re.cloud.com
Thanks in advance.
Solved! Go to Solution.
19 Mar 2021 08:29 PM
thanks for your answer.
19 Mar 2021 07:00 PM
I'd recommend using what @Babar_Qayyum supplied, if that still fails (which i dont expect) then maybe make 4 rules, one for each line item to ensure they are working correctly.
19 Mar 2021 08:24 PM
Thanks, finally instead of doing one rule, I made one for 1 and 4 and other one for the 2,3. It's not what I wanted, but the field is limited to 80 chars, so If in a future I add more examples it would be easier to maintain.
19 Mar 2021 08:27 PM
great to hear, but yes I've run into issues too with character limits for regex, but still cut down on the overall rules. glad it worked
Maybe toss in a RFE for that limit to be raised.
19 Mar 2021 08:28 PM
Good Idea, I've done a request and wait if it accepted. Thanks for your answers.
19 Mar 2021 08:29 PM
toss along the link and ill up vote it
19 Mar 2021 08:36 PM
https://community.dynatrace.com/t5/Dynatrace-product-ideas/RFE-Raise-Regex-Field-Limit/idi-p/163183
Done