I want to fetch all the xhr actions inside a web application. I am using following usql query(and sending it as a param in GET /api/v1/userSessionQueryLanguage/table
SELECT useraction.name, COUNT(*) AS action_count FROM usersession WHERE useraction.application = ‘Temperstack-Local’ AND useraction.type = ‘Xhr’ AND useraction.startTime >= $NOW - DURATION(“1d”) GROUP BY useraction.name ORDER BY action_count DESC
Where I am facing issue is getting result based on timeframe.
Even if I use: useraction.startTime >= ‘yyyy-mm-dd’, it won’t work.
What works is selecting the desired timeframe in the dynatrace UI.
What exactly am I doing wrong?
I have tired many options without any success. Maybe our synthax is woring.
This option works only form me (becuase $NOW $TIME_FRAME_START are time variables) and but I think it will not a solution for you which is similar to $NOW:
SELECT useraction.name, COUNT(*) AS action_count FROM usersession WHERE ((useraction.application=‘Phoenix’ OR userevent.application=‘Phoenix’ OR usererror.application=‘Phoenix’)) AND useraction.startTime >=$TIME_FRAME_START - DURATION(“1d”) GROUP BY useraction.name
Next oprion was the unix time, I have not received any error message (because it a numeric number) but did not work…
SELECT useraction.name, COUNT(*) AS action_count FROM usersession WHERE ((useraction.application=‘Phoenix’ OR userevent.application=‘Phoenix’ OR usererror.application=‘Phoenix’)) AND useraction.startTime >=1723327200 - DURATION(“1d”) GROUP BY useraction.name