Hi -
I had the below regex working fine in a workflow
“| filter matchesRegex(lower(cicd.pipeline.url.full),”.*/\\.github/workflows/.*(ci|standard).*\\.ya?ml$“)”
Now i’m getting the below error for the same. Is there any way I can get it to work with other functions?
I have been trying with matchesPattern or matchesValue .. nothing is working
I’m trying to use regex to get the pattern as - .github/workflows/*ci*.yam*
"notifications": [
{
"message": "The function `matchesRegex()` is experimental and may be changed or removed at any time. Please change your query to use the function `matchesPattern()` instead.",
"severity": "INFO",
"arguments": [
"matchesRegex",
"matchesPattern"
],
"messageFormat": "The function `%1$s()` is experimental and may be changed or removed at any time. Please change your query to use the function `%2$s()` instead.",
"syntaxPosition": {
"end": {
"line": 30,
"index": 1264,
"column": 104
},
"start": {
"line": 30,
"index": 1170,
"column": 10
}
},
"notificationType": "DEPRECATED_FUNCTION_EXPERIMENTAL_USE_REPLACEMENT",
"messageFormatSpecifierTypes": [
"FUNCTION_NAME",
"FUNCTION_NAME"
]
there is a post that might bring some light to your question: https://community.dynatrace.com/t5/DQL/Regex-in-DQL/m-p/273446. The matchesRegex() function is being deprecated in favor of the matchesPattern() function, which allows standard wildcards (* and ?).
Did you try to add a new filter condition? Something like this:
| filter matchesPattern(lower(cicd.pipeline.url.full), "*/.github/workflows/*ci*.yam*")
or matchesPattern(lower(cicd.pipeline.url.full), "*/.github/workflows/*standard*.yam*")
Sorry. After checking that error message more carefully I realized I misled you, because the wildcard * doesn’t work in DPL (Dynatrace Pattern Language), but in DQL (Dynatrace Query Language). In DPL the wildcard to represent “anything” (like what * does) is LD (Line Data), or DATA.
Since the function matchesPattern() uses DPL you need to use the LD in your command.
From my research, you can also use the function matchesValue() which actually supports the * wildcard. If you use this approach instead, I suggest using it with the partial match. Maybe something like this: