Skip to main content

Overview

Slung uses a simple yet powerful query DSL with the following format:
OP:SERIES:[TAGS]:[RANGE]
The RANGE component is optional. Queries without a time range will operate on all available data.

Query Components

Operation (OP)

The operation to perform on the data. Supported operations:
  • AVG - Calculate the average value
  • MIN - Find the minimum value
  • MAX - Find the maximum value
  • SUM - Sum all values
  • COUNT - Count the number of data points
The OP field is optional. When omitted, you can retrieve all matching values without aggregation.

Series

The name of the time series to query (e.g., cpu.total, memory.used, requests.count).

Tags

Tag filters enclosed in square brackets. See the Tags page for detailed tag syntax and operators.

Range

Optional time range specification enclosed in square brackets. See the Time Ranges page for syntax details.

Examples

Basic Query with Time Range

AVG:series1:[tag1 AND tag2]:[start_time,end_time]
Calculate the average of series1 for data points matching both tag1 and tag2 within the specified time range.

Minimum Value with OR Logic

MIN:series2:[tag3 OR tag4]:[start_time,end_time]
Find the minimum value in series2 for data points matching either tag3 or tag4.

Maximum Value with NOT Operator

MAX:series3:[tag5 NOT tag6]:[start_time,end_time]
Find the maximum value in series3 for data points that have tag5 but not tag6.

Sum with Single Tag

SUM:series4:[tag7]:[start_time,end_time]
Sum all values in series4 that have tag7.

Count with Time Range

COUNT:series5:[tag8]:[start_time,end_time]
Count data points in series5 with tag8.

Query Without Time Range

SUM:series6:[tag9]
Sum all values in series6 with tag9, regardless of time.

Real-World Example

AVG:cpu.total:[region=us-west AND NOT host=test]:[1700000000,1700000100]
This query:
  • Calculates the average CPU usage
  • For the cpu.total series
  • Where data has region=us-west tag AND does NOT have host=test tag
  • Between timestamps 1700000000 and 1700000100 (microseconds)

Next Steps

Aggregations

Learn about aggregation operations

Time Ranges

Master time range syntax

Tags

Explore tag filtering

Build docs developers (and LLMs) love