Filters

This section of the document provides LOGQL general syntax and the related information. The search query consists of attributes, operators and a value. You can use the mouse or down-arrow key to highlight and select the attribute you want.

Example query syntax:

Example query result:

Switching between Basic QL and Advanced QL

Previously, switching between query modes could result in the loss of selected filters and query context, requiring users to recreate searches manually. To provide a seamless query-building experience, Log Management now preserves supported filters, operators, search criteria, and time range when switching between Basic QL and Advanced QL, enabling users to continue investigations without interruption.

Basic QL to Advanced QL

When you switch from Basic QL to Advanced QL, OpsRamp automatically converts the selected filters into an equivalent Advanced QL query. Since Basic QL supports only AND conditions between filters, the generated Advanced QL query contains only AND operators.

When switching from Advanced QL to Basic QL, only queries that can be represented using AND conditions are supported. If the Advanced QL query contains unsupported expressions such as OR, NOT, nested conditions, or other advanced query constructs, the query cannot be translated into Basic QL.

In such cases, OpsRamp displays the following message:

Users can continue working in Advanced QL or modify the query to use only supported AND conditions before switching to Basic QL.


Persisting Query Filters

Log Management preserves query context when switching between Basic QL and Advanced QL, ensuring that users can continue their investigation without losing previously configured search criteria.
The following query attributes remain unchanged during query mode transitions:

  • Selected filters
  • Time range
  • Search text
  • Query state
  • Applied operators

By preserving query context, users can move between query modes while maintaining the continuity of their search workflow and avoiding the need to recreate existing queries.

Time bucket (step) support in LogQL

OpsRamp Log Management supports explicit time bucket (step) values in Log Query Language (LogQL) time-series queries. A step controls the aggregation interval used for analysis and visualization, providing consistent granularity across time ranges. When you specify a step, LogQL uses that interval for bucket generation. Otherwise, LogQL selects a bucket based on the time range using the standardized OpsRamp auto-bucketing logic.

This allows users to control time-series aggregation granularity by specifying explicit time bucket values, ensuring consistent bucket intervals across repeated query executions and different time ranges. It aligns LogQL behavior with the standardized OpsRamp time-bucketing model, improves chart readability and result predictability, and enables the use of fixed aggregation intervals for more accurate and consistent time-series analysis and visualization.

Supported step values

The standard OpsRamp intervals are:

CategoryValues
Minutes1m, 5m, 10m, 15m, 30m
Hours1h

Using step values in LogQL

Specify a time bucket in a LogQL time-series query.

For example:

... | timeseries(5m)

This query aggregates results into five-minute buckets.z

Step selection behavior

When a step is specified

LogQL uses a supported explicit step for time-series bucket generation.

For example:

... | timeseries(1h)

Results are aggregated into one-hour buckets regardless of the automatically calculated bucket size.

When a step is not specified

LogQL selects a bucket based on the selected time range.

Precedence rules

An explicit step takes precedence over an automatically selected bucket. The precedence order is:

  1. Explicit LogQL step
  2. Standardized auto bucket

For example, if the selected time range is 24 hours, the auto bucket is 15m, and the query step is 5m, LogQL applies 5m.

Time-series bucket generation

The step determines the interval between consecutive buckets. For a 24-hour time range with a 5m step, the approximate number of buckets is:

24 × 60 ÷ 5 = 288 buckets

The actual number may vary based on data availability and query execution boundaries.

Auto-bucketing logic

When no step is specified, LogQL uses the standardized time-range-to-bucket mapping:

Time rangeAuto step / time bucketApproximate data points
≤ 1 hour1 minute~60
1–3 hours1 minute~180
3–6 hours5 minutes~72
6–12 hours10 minutes~72
12–24 hours15 minutes~96
1–3 days30 minutes~144
> 3 days1 hourBased on selected range

Validation rules

LogQL validates step values before query execution. Only supported time-bucket values are accepted.

Examples include 1m, 5m, 15m, 30m, and 1h.

A query with an invalid or unsupported step fails with a validation error.