cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trim GUID from a URL

dataplayer
Newcomer

How can i extract only the GUID (in bold) from the following url using TRIM function with USQL:

test.abc.com/CRMX/workplace/home_dashboards.aspx?sitemappath=Workplace%7cMyWork%7cnav_dashboards&pagemode=iframe&dashboardId=%7bf2b9e0b0-57e7-ed12-9142-005046962a4c%7d&dashboardType=1031

 

SELECT useraction.targetUrl AS "DashboardId",
FROM useraction where useraction.targetUrl LIKE "*dashboardId*"
GROUP BY DashboardId
ORDER BY useraction.targetUrl DESC

1 REPLY 1

PierreGutierrez
Dynatrace Mentor
Dynatrace Mentor

Hi @dataplayer 
The function TRIM or some function that make the same functionality (like in SQL Database) doesn't exist in Dynatrace USQL.

I think in 2 possibilities to help you:

1 .- Use Session and action properties: If you can catch the same data (targetUrl) with any "Expression type " , you can apply Regex (Apply cleanup rule) . Then you can use that value in USQL 💪

PierreGutierrez_0-1714263833638.png


2.- Business Event:  If you want to identify and apply some rules like TRIM. Or You can and want to send exactly the value of DashboardID . I recommend you use Business Event 🚨
https://docs.dynatrace.com/docs/shortlink/ba-business-events-capturing#report-business-event-rum 

I hope it's helpful 💪

Pierre Gutierrez - LATAM ACE Consultant - Loving Cats! Loving Technology !

Featured Posts