Skip to Content
KubeSense

Filtering on logs

The fields the Logs filter bar accepts, how body search works, and worked examples for everyday log filtering.

This page is for anyone who searches logs in the Log Explorer. It lists the log fields and task examples you can copy. The language rules are in the filter quick reference.

Fields

The last column gives the column name that SPL and SQL use, where it differs. A field not in the list is an error, and the bar suggests the closest names.

FieldTypeTakesSQL column
workloadstringvalue, OR list, * ?, ~Same
servicestringvalue, OR list, * ?, ~Same
namespacestringvalue, OR list, * ?, ~Same
domainstringvalue, OR list, * ?, ~cluster
instancestringvalue, OR list, * ?, ~pod_name
containerstringvalue, OR list, * ?, ~container_name
nodestringvalue, OR list, * ?, ~host
typestringvalue, OR list, * ?, ~level
formatstringvalue, OR list, * ?, ~Same
sourcestringvalue, OR list, * ?, ~Same
regionstringvalue, OR list, * ?, ~Same
app_versionstringvalue, OR list, * ?, ~Same
env_typestringvalue, OR list, * ?, ~Same
bodystringword, phrase, part of a line, OR or AND listSame

Notes on the fields:

  • type is the log level, with values such as ERROR, WARN, INFO and DEBUG.
  • domain is the cluster, and instance is the pod. The filter bar refuses the old names pod_name and cluster.
  • Every field except body is text, with exact, case-sensitive matching. Logs have no numeric field. Use an attribute for a number.

The full list with example values is in Log and trace fields.

Body and attributes

body is the log message. body:timeout matches the whole word, and a word on its own, timeout, means the same. The bar suggests no values after body:, because log lines make poor suggestions and finding them is slow. You get your recent searches instead. The rules are in Searching the log body and Words without a field.

Attributes start with @, as in @http.status_code>=500. See Attributes. On logs, -@key:value matches rows that have the key with a different value, not rows that lack the key. To match inside a list, write @tags[*]:prod. See Lists in a log.

Examples

Body search examples are in the quick reference.

TaskFilterWhat it matches
Errors from checkoutworkload:checkout type:ERRORLines from the checkout workload at level ERROR.
Errors and warnings in one namespacenamespace:prod type:(ERROR OR WARN)Lines in prod at either level.
Everything except debug noisenamespace:prod -type:(DEBUG OR TRACE)Lines in prod that are not at those two levels.
Exclude health checksworkload:checkout -body:(healthz OR readyz)checkout lines that mention neither word.
All pods of one workloadinstance:checkout-* type:ERRORErrors from pods whose name starts with checkout-.
One nodenode:ip-10-0-1-* type:ERRORErrors from nodes whose name starts with ip-10-0-1-.
One clusterdomain:prod-eu type:ERRORErrors from the cluster named prod-eu.
Server errors from an attribute@http.status_code>=500Lines whose http.status_code attribute is 500 or more.
One user@user.id:u-1042 type:ERRORErrors that carry that user.id.
Lines that carry a request idworkload:checkout @request_id:*checkout lines that have a request_id attribute.

With a word on its own:

TaskFilterWhat it matches
A phrase in one workloadworkload:checkout "payment failed"checkout lines that contain payment failed.

See Filtering on each screen for the other screens that take log filters.

On this page