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

How do I query dynatrace API for Dashboard data with a custom time filter?

karthik_balasub
Newcomer

Hello

Am trying to query dynatrace API with a custom time filter. I read the docs at https://community.dynatrace.com/community/pages/viewpage.action?pageId=221381502&_ga=2.189086697.313.... My query is asking for data from Jan 2 06:00:00 to Jan 2 07:00:00, but the data that I get back seems to reflect data from the last one hour.

Query: http://myserver:8021/rest/management/dashboard/myd...

Is there anything that am missing here? Any help would be greatly appreciated

Thanks

K

3 REPLIES 3

joel_stuart
Dynatrace Participant
Dynatrace Participant


Hi Karthik,



Your filter string syntax just needs to changed from


filter=CustomTimeframe


to


filter=tf:CustomTimeframe

(an added ':tf')



Hope that helps.



Joel



Further resource on REST filters:

https://community.dynatrace.com/community/display/...

Thanks, that helped. I have a follow up question. When I use dynatrace client, I can see that my dashboard contains millions of rows of data for a single day. When I want to access the data through REST interface, I obviously don't want to query for all the data, hence am trying apply some filters. For example, i want to see only rows that contains the word "login" in the URL. To do that, am using the following URL

http://myserver:8021/rest/management/dashboard/mydashboard?filter=ca:srcurl?login@contains&filter=tf...

But I dont seem to get anything back from Dynatrace. Am unsure, how to use the filters, can you please educate me there?

Thanks

K

No worries Karthik.

Regarding the followup question the ca filter options are for a different Dynatrace product integration and most likely aren't what you want. Looking through the filters, most relevant to achieve what you want:

Web Request Filters - you could filter by specifying the URL of the login action.

Web Request Tag Filters - you could filter by web requests tagged with a 'login' tag. Note: this would mean additional requirement of tagging the web requests.

The further filtering options may be otherwise limited for what you're trying to achieve.

Best,

Joel