Chaining commands with the pipe operator
A DQL query contains at least one or more commands, each of which returns tabular output containing records (lines or rows) and fields (columns). All commands are sequenced by a | (pipe). The data flows or is funneled from one command to the next. The data is filtered or manipulated at each step and then streamed into the following step.
The Dynatrace Query Language (DQL) is a powerful tool to explore your data and discover patterns, identify anomalies and outliers, create statistical modeling, and more based on data stored in Dynatrace Grail storage.
Here is a list of DQL commands:
Here is a list of DQL commands:
- fetch – Fetches data from a specific data type, such as logs, metrics, or business events.
- filter – Filters the data based on a specified condition.
- fields – Selects the fields that you want to include in the output.
- fieldsAdd – Adds new fields to the output.
- parse – Parses the data into a different format.
- summarize – Performs aggregations on the data, such as counting the number of rows, or finding the average value of a column.
- sort – Sorts the data based on a specified field.
- limit – Limits the number of rows that are returned in the output.
- timeseries – Produces a time series of aggregated data.
- fieldsSummary – Calculates the cardinality of field values that the specified fields have.
Here is a list of DQL Functions:
The following is a list of DQL functions:
- avg – Calculates the average of the values in a column.
- count – Counts the number of rows in a table.
- count_distinct – Counts the number of distinct values in a column.
- first – Returns the first value in a column.
- last – Returns the last value in a column.
- max – Returns the maximum value in a column.
- min – Returns the minimum value in a column.
- percentile – Returns the percentile value of the values in a column.
- sum – Calculates the sum of the values in a column.
DQL operators
Numerical operators
The types long
, double
and timestamp
real represent numerical types. The following operators can be used between pairs of these types
Operator | Description | Example |
---|---|---|
+ | Addition | 2+2.5 |
- | Subtraction | 0.2-0.11 |
* | Multiplication | 4*5, 60*1s |
/ | Division | 10/2, 1h/60 |
% | Modulo | 4%2 |
< | Lower | 8 < 9, now()-1m < now() |
<= | Lower than or equal | 4<=5 |
> | Greater | 5 > 4 |
>= | Greater than or equal | 4 >=4 |
== | Equals | 2 == 2 |
!= | Not equals | 1 != 2 |
Logical or equality operators
Operator | Description | Example (yields true) |
---|---|---|
== | Equals – Yields true if both operands are not null and equal to each other. Otherwise, false. | 2==2 , "a" == "a" |
!= | Not equals – Yields null, if one of the operands is null, or if the operands are not equal to each other. | 2!=1, "b" != "a" |
NOT | Negation – Negates a logical state | NOT 2==1 |
AND | Logical and (multiplication) – Yields true if both operands are true. | NOT 2==1 AND 1<2 |
OR | Logical or (addition) – Yields true if one of the operands is true, regardless of the other operand. | 1 < 2 OR 1 > 2 |
XOR | Exclusive or – Yields true if one of the operands is true, but false in case both are true. | 1 < 2 XOR 1 > 2 |
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024
- Introduction to System Operations (SymOps) - October 30, 2024