Add data to a dashboard
Latest Dynatrace
Add data
To Query Grail
-
In the upper-right of the dashboard, open the
Add menu and select
Query Grail.
An Options side panel opens on the right.
-
In the edit box, use the Dynatrace Query Language (DQL) to define your query.
-
Select Run query to execute the DQL query and display visualization options.
-
In the Result section, select Select visualization to choose a visualization format for your results.
If a visualization is already selected, you can select Change visualization to select a different visualization.
-
Select < Options to return to the Options panel.
-
In the Result section, select Customize… to adjust visualization settings as needed.
-
Select < Options to return to the Options panel.
-
Close the side panel when you're done.
Specify a custom timeframe
To specify a custom timeframe for your data tile such that it will ignore the one set in the upper-right corner of the dashboard, you can add your desired timeframe to your DQL query like:
fetch [recordtype], from:now() - 2h
| ....
For details regarding specifying a timeframe in DQL, see Specify timeframe in DQL documentation.
Data example 1
fetch logs
| summarize loglines = count(), by:{`1m interval` = bin(timestamp, 1m), status}
Data example 2
Create two variables
In case you haven't created a variable yet, first see Add a variable to a dashboard.
-
Select Add variable and define the first variable.
- Name:
Hosts
- Type:
Query
- Query:
fetch logs | summarize count(), by:`dt.entity.host` | limit 100 | sort `count()`, direction:"descending" | fields `dt.entity.host`
- Multi-select: turned on
- Name:
-
Select Add variable and define the second variable.
- Name:
Loglevel
- Type:
Query
- Query:
fetch logs, from:now() - 2h | summarize count(), by:loglevel | sort `count()`, direction:"descending" | fields loglevel
- Multi-select: turned on
- Name:
Add data
Now add data while referencing your previously created variables $LogLevel
and $Hosts
so that you can later use the variable filters on top of your dashboard to filter the tile according to your selections.
fetch logs
| filter in(loglevel,array($Loglevel))
| filter in(dt.entity.host, array($Hosts))
| summarize count(), by:{bin(timestamp, 1m)}
Select Run query.