Overview
Slung uses a simple yet powerful query DSL with the following format: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 valueMIN- Find the minimum valueMAX- Find the maximum valueSUM- Sum all valuesCOUNT- 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
series1 for data points matching both tag1 and tag2 within the specified time range.
Minimum Value with OR Logic
series2 for data points matching either tag3 or tag4.
Maximum Value with NOT Operator
series3 for data points that have tag5 but not tag6.
Sum with Single Tag
series4 that have tag7.
Count with Time Range
series5 with tag8.
Query Without Time Range
series6 with tag9, regardless of time.
Real-World Example
- 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