Kubesense

Search & Querying

KubeSense provides three levels of search capability — Basic Search, Advanced Query, and Search Processing Language (SPL) — giving you the flexibility to perform quick lookups or complex analytical queries.

The basic search mode uses a tag-based approach. Type a filter key and value directly into the search bar, and KubeSense creates a visual filter tag. You can combine multiple filter tags to progressively narrow your results.

type:ERROR namespace:sre-agent

Basic Search — Filter tags

Basic search also supports free-text search. Type any keyword (e.g., exception) alongside your filter tags, and KubeSense will scan through your entire log corpus — across millions of log entries — to find all messages containing that string. Matching keywords are highlighted in yellow for easy identification.

Free Text Search — Keyword highlighting


Advanced Query

For more precise control, switch to Advanced Query mode by clicking the query editor toggle. This mode supports a SQL-like syntax with logical operators, comparison operators, and pattern matching.

type = ERROR AND namespace = "sre-agent" AND body ILIKE '%exception%'

Advanced Query — SQL-like syntax

Supported Operators

OperatorDescriptionExample
=Exact matchtype = ERROR
!=Not equaltype != DEBUG
INMatch any value in a listtype IN ["ERROR", "WARN"]
LIKEPattern match (case-sensitive)body LIKE '%timeout%'
ILIKEPattern match (case-insensitive)body ILIKE '%exception%'

Search Operators

Logical Connectors

Combine conditions using AND and OR operators to build complex queries:

type = ERROR AND namespace = "sre-agent"
type = ERROR OR type = WARN

Logical Operators — AND / OR

Field Autocomplete

The query editor provides intelligent autocomplete. After typing a logical connector like AND, you are presented with all available fields to filter on:

  • type, source, format, workload, namespace, node_name, instance

Field Autocomplete

Search Syntax Reference

ModeSyntaxExample
Normal Searchkeyoperatorvaluetype = ERROR
Attribute Search@keyoperatorvalue@span_id = "abc123"

Keys or values containing special characters must be enclosed in quotes or backticks.


Search Processing Language (SPL)

KubeSense includes a built-in Search Processing Language (SPL) — a pipe-based query language for performing advanced log analytics, aggregations, and transformations directly within the Log Explorer. SPL enables you to go beyond simple filtering and perform real-time statistical analysis on your log data.

Simple SPL Query

Use SPL to filter logs and compute statistics in a single query:

fields * | filter body like "%Request failed%" | stats count(*) as failures by @message

This query scans all log fields, filters for entries containing "Request failed", and counts the occurrences grouped by message — returning a clean summary table.

SPL Query — Simple aggregation

Complex SPL Query

SPL supports multi-stage pipelines with field aliasing, conditional aggregations, and computed columns:

fields timestamp, workload as application_name, level as severity, body as text
| filter application_name != "" and severity in ["ERROR", "WARN", "INFO"]
| stats count(*) as total, sum(severity = "ERROR") as errors, sum(severity = "WARN") as warns by application_name
| eval error_rate = errors / total

This query computes the error rate for every application in your cluster, producing a table with total logs, error count, warning count, and the calculated error rate per workload.

SPL Query — Complex analytics with error rates

info: SPL is a powerful query language with many more capabilities including sorting, deduplication, regex extraction, time-based bucketing, and more. See the SPL Reference Guide for the complete documentation.