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

What is the best method to work with API extracted data?

Hello all,

I hope I will make my question clear;

I want to extract data using Dynatrace API, to look for hosts that are listed as "Monitoring Candidate" and so on...

I find it hard to work with the extracted data from the API, for example, if I'm extracting the list of hosts, I see many parameters I don't need. I want for example to filter only the "Monitoring Candidates" but I don't know how.

You guys have any tips? a software I can use to work with?

Thank you.

3 REPLIES 3

Yosi_Neuman
DynaMight Guru
DynaMight Guru

Hi @YuvalKonstanti 

In order to make the output more useful you can:

  1. Convert the json to csv with some online converters and work on the CSV.
  2. Use Host Report (by Erik Landsness) just save it to your google drive, add your tenant id and token in config tab and run it from the dynatrace menu entry. 
  3. Connect your rest API with your company BI tools and play with data as you like. 

HTH

Yos 

dynatrace certificated professional - dynatrace master partner - Matrix Soft Ware Division - Israel

adam_gardner
Dynatrace Champion
Dynatrace Champion

The new /api/v2 "monitored entities" set of endpoints make this easier.

 

First, have a look at the possible properties for a particular entity (eg. HOST)

 

GET https://abc12345.live.dynatrace.com/api/v2/entityTypes/ENTITY-TYPE
eg.
GET https://abc12345.live.dynatrace.com/api/v2/entityTypes/HOST

Gives:

{
  "type": "HOST",
  "displayName": "Host",
  "dimensionKey": "dt.entity.host",
  "entityLimitExceeded": false,
  "properties": [
...
{
      "id": "isMonitoringCandidate",
      "type": "Boolean",
      "displayName": "isMonitoringCandidate"
    }
...
]

Now get the hosts and ask for that additional property:

 

GET https://abc12345.live.dynatrace.com/api/v2/entities?entitySelector=type(HOST)&fields=properties.isMonitoringCandidate

 Gives

{
  "totalCount": 1,
  "pageSize": 50,
  "entities": [{
      "entityId": "HOST-1234706CD0451ABC",
      "displayName": "myHostname",
      "properties": {
        "isMonitoringCandidate": false
      }
    }]
}

adam_gardner
Dynatrace Champion
Dynatrace Champion
GET https://abc12345.live.dynatrace.com/api/v2/entities?entitySelector=type(HOST)&fields=properties.isMonitoringCandidate

 

To see all valid properties for an entity:

https://abc12345.live.dynatrace.com/api/v2/entityTypes/HOST

Featured Posts