Skip to content

or

There are two variants of the :or operator.

Choosing

Input Stack:
query2: Query
query1: Query
Output Stack:
(query1 OR query2): Query
 

This first variant is used for choosing the set of time series to operate on. It is a binary operator that matches if either of the sub-queries match.

Parameters

  • query1: First query condition to check
  • query2: Second query condition to check (result matches if either query1 OR query2 is true)

Examples

Match time series that satisfy either condition:

For example, consider the following query:

nf.app,alerttest,:eq,
name,ssCpuUser,:eq,
:or

When matching against the sample data in the table below, the highlighted time series would be included in the result set:

Namenf.appnf.node
ssCpuUser alerttest i-0123
ssCpuSystem alerttest i-0123
ssCpuUser nccp i-0abc
ssCpuSystem nccp i-0abc
numRequests nccp i-0abc
ssCpuUser api i-0456

Math

Input Stack:
ts2: TimeSeriesExpr
ts1: TimeSeriesExpr
Output Stack:
(ts1 OR ts2): TimeSeriesExpr
 

Compute a new time series where each interval has the value (a OR b) where a and b are the corresponding intervals in the input time series.

Parameters

  • ts1: First time series expression
  • ts2: Second time series expression

Examples

Boolean OR operation on time series values:

Time a b a OR b
00:01 0.0 0.0 0.0
00:01 0.0 1.0 1.0
00:02 1.0 0.0 1.0
00:03 1.0 1.0 1.0
00:04 0.5 1.7 1.0

The result will be a signal time series that will be 1.0 for all intervals where the corresponding values of a or b are non-zero.

Creating a signal that's true when time is either greater than 300 OR less than 290 minutes:

BeforeAfter
minuteOfDay,:time,
:dup,
300,:gt,
:swap,
290,:lt
minuteOfDay,:time,
:dup,
300,:gt,
:swap,
290,:lt,
:or
  • :and - Logical AND operation (matches only if both conditions are true)
  • :not - Logical NOT operation (inverts boolean values)
  • :eq - Basic equality comparison for building query conditions
  • :gt, :lt - Comparison operations for building math conditions