Skip to main content
The series_ceiling function applies the ceiling operation to each element in a dynamic array (series) of numeric values. It rounds each number up to the nearest integer, returning the smallest integer that’s greater than or equal to the input value. This function is useful when you need to normalize fractional values upward or ensure minimum thresholds in your data analysis. You can use series_ceiling when working with metrics that need to be rounded up for capacity planning, resource allocation, or when dealing with partial counts that should be treated as whole units. Common applications include calculating minimum required resources, rounding up processing times for SLA calculations, and normalizing fractional measurements.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
In Splunk SPL, you use the eval command with the ceil() function to round values up. In APL, series_ceiling applies the ceiling operation to all elements in a dynamic array at once.
... | eval rounded_duration = ceil(duration)
In SQL, you use the CEILING() or CEIL() function to round individual values up. However, this only works on scalar values, not arrays. In APL, series_ceiling operates on entire dynamic arrays, making it convenient for series analysis.
SELECT CEILING(duration) AS rounded_duration
FROM requests;

Usage

Syntax

series_ceiling(array)

Parameters

ParameterTypeDescription
arraydynamicA dynamic array of numeric values.

Returns

A dynamic array where each element is the ceiling (rounded up to the nearest integer) of the corresponding input element.

Use case examples

  • Log analysis
  • OpenTelemetry traces
  • Security logs
In log analysis, you can use series_ceiling to round up request durations for capacity planning, ensuring you allocate sufficient resources based on worst-case scenarios.Query
['sample-http-logs']
| summarize durations = make_list(req_duration_ms / 1000.0) by id
| extend ceiling_durations = series_ceiling(durations)
Run in PlaygroundOutput
iddurationsceiling_durations
u123[0.12, 0.87, 1.23][1, 1, 2]
u456[2.45, 0.56][3, 1]
This query converts request durations to seconds and rounds them up to ensure adequate resource allocation for each user.
  • series_abs: Returns the absolute value of each element in an array. Use when you need to remove negative signs without rounding.
  • series_add: Performs element-wise addition between two arrays. Use when you need to combine values instead of calculating ratios.
  • series_cosine_similarity: Calculates cosine similarity between two arrays. Use when you need normalized similarity measures rather than raw dot products.
  • series_divide: Performs element-wise division between two arrays. Use when you need to calculate ratios or normalize values.
  • series_dot_product: Calculates the dot product between two arrays. Use when you need the raw dot product value rather than normalized similarity.
  • series_sum: Calculates the sum of all elements in a single array. Use when you need to sum elements within one array rather than computing dot products.