CQL guide

Write your first Drillo queries. Search, then pipe into stages.

On this page

A CQL query is a search expression followed by optional stages joined with |. The time range is not part of the query: it comes from the time picker (or the from/to fields of the API).

cql
level IN (error,fatal) | stats count() by service | sort -count

First queries#

Free text matches the message, ignoring case:

cql
timeout

A quoted phrase also ignores case. Prefix it with c to match case exactly:

cql
"db timeout"
c"OOMKilled"

Filter on fields, then combine with AND, OR, NOT and parentheses. Terms next to each other are joined with AND:

cql
service=pay-api level IN (error,fatal) NOT host=app2

Match a regular expression with ~:

cql
http_path ~ "^/api/v1/(pay|refund)"

Aggregate with stats, bucket over time with timechart:

cql
log_type=nginx | timechart span=5m count() by http_status

What a plain search returns#

Without an aggregation stage you get raw rows: ts, service, level and msg, newest first, at most 500 rows.

Next#

CQL reference, Examples and saved queries, Cheat sheet.

Report an inaccuracy (opens a support ticket in the portal; nothing is sent from this page)