Pipeline Operations

Overview

Pipeline operations transform query results using the pipe operator |. Chain multiple operations together to filter, sort, limit, rename fields, and more. Operations are executed sequentially from left to right.

Syntax

<query> | <operation1> | <operation2> | <operation3>

Each operation processes the output of the previous step.

sort

Order results by one or more fields.

Syntax:

| sort by (field1 [asc|desc], field2 [asc|desc], ...)

Single field:

* | stats by (workload) count() as total | sort by (total desc)

Multiple fields:

* | stats by (workload) count() | sort by (workload asc, count desc)

limit

Limit the number of results returned.

Syntax:

offset

Skip a number of results (for pagination).

Syntax:

Records 21-30 (page 3)

fields

Select specific fields to include in results (similar to SQL SELECT).

Note: The fields pipe does not work with time-series visualizations. For time-series queries, all fields from the aggregation are included automatically.

Syntax:

rename

Rename fields for clarity or compatibility.

Syntax:

format

Format output strings using a template with field values.

Syntax:

uniq

Get unique combinations of specified fields (similar to SQL DISTINCT + GROUP BY).

Syntax:

Unique workloads

filter

Apply additional filters after aggregations or transformations.

Syntax:

Aliases: | <filter_expression> (implicit)

Workloads with more than 1000 logs

math

Perform mathematical calculations on fields and create new calculated fields.

Syntax:

Arithmetic Operators:

  • + - Addition

  • - - Subtraction

  • * - Multiplication

  • / - Division

  • % - Modulo

  • ^ - Power

Functions:

  • max(a, b) - Maximum of two values

  • min(a, b) - Minimum of two values

  • abs(x) - Absolute value

  • exp(x) - Exponential (e^x)

  • ln(x) - Natural logarithm

  • round(x) - Round to nearest integer

  • ceil(x) - Ceiling (round up)

  • floor(x) - Floor (round down)

  • rand() - Random number

  • now() - Current timestamp

Basic Arithmetic

Calculate error rate

Complex Expressions

Operator precedence follows standard math rules (multiplication/division before addition/subtraction).

Expression with precedence: (a / b) - 3

Weighted health score

With Functions

Round to integer

Chaining Math Operations

Chain multiple math operations

With Join

Calculate ratio from joined data

Last updated