All query examples on this page work in Grafana dashboards with a timestamp alteration. Replace the static timestamp filters with dynamic time functions.
When filtering log messages for specific text, use position() instead of LIKE ‘%text%’ or ILIKE ‘%text%’. The position() function is more efficient because it’s optimized for substring searches without triggering full table scans or expression slowdowns.
This table is intentionally large and wide. It includes hundreds of fields to support deep observability and debugging. It's important to use targeted filters and time bounds to keep your queries fast and efficient.
This example replaces values with [num] instead of 1024 MB or 3.5 GB. The query groups errors like merge would use too much memory (estimated: 512 MB, allowed: 128 MB) into one normalized line.
SELECTkubernetes.pod_name,message,timestampFROMhydro.logsWHEREtimestamp>NOW()-INTERVAL1DAYANDstream='stderr'ANDlevel='error'AND(position(message,'OOMKilled')!=0ORposition(message,'out of memory')!=0);
SELECTtimestamp,app,messageFROMhydro.logsWHEREtimestamp>NOW()-INTERVAL6HOURANDlevel='error'AND(position(message,'table not found')!=0ORposition(message,'invalid table')!=0);
SELECTcomponent,count(*)ASzstd_errorsFROMhydro.logsWHEREtimestamp>NOW()-INTERVAL1DAYANDlevel='error'ANDapp='intake-head'ANDposition(error,'failed to decompress ZSTD')!=0GROUPBYcomponentORDERBYzstd_errorsDESC;
Daily error count - ZSTD decompression and fatal errors⚓︎
Track fatal errors and ZSTD decompression failures by app and container.
SELECTDISTINCTextractAll(assumeNotNull(error),'partition=(.*?\\.hdx)')[1]AScorrupt_partition,COUNT(*)ASerror_countFROMhydro.logsWHEREtimestamp>NOW()-INTERVAL1DAYANDappIN('merge-peer')ANDlevelIN('error')ANDposition(error,'BasicBuf: failed to decompress ZSTD block Data corruption detected')!=0GROUPBYcorrupt_partitionORDERBYerror_countDESC;