Add data to a dashboard
Latest Dynatrace
Add data
The fastest and easiest way to query your logs is to use the new query builder. In a few seconds, you'll have a working log query you can add to your document and tweak as needed.
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
You can specify a custom timeframe in a data tile's DQL query so that it ignores the dashboard timeframe set in the upper-right corner of the dashboard. Using this method, a dashboard can have multiple tiles where each tile has its own timeframe.
Example timeframe specification in DQL:
1fetch [recordtype], from:now() - 2h2 | ....
For details on specifying a timeframe in DQL, see Specify timeframe in the DQL documentation.
Data example 1
1fetch logs2| 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:
1fetch logs2| summarize count(), by:{`dt.entity.host`}3| limit 1004| sort `count()`, direction:"descending"5| fields `dt.entity.host`
- Multi-select: turned on
- Name:
-
Select Add variable and define the second variable.
- Name:
Loglevel
- Type:
Query
- Query:
1fetch logs, from:now() - 2h2| summarize count(), by:{loglevel}3| sort `count()`, direction:"descending"4| 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.
1fetch logs2| filter in (loglevel, {$Loglevel})3| limit 10
Select Run query.