A query is composed of terms and operators. Terms can search the message or a specific field.

There are two types of terms:

  • A single term is one unquoted word, such as timeout or chalkruntime.
  • A phrase is text surrounded by double quotes, such as "hello world".

Use Boolean operators to combine terms. Operators are case sensitive and must be uppercase.

OperatorDescriptionExample
ANDIntersection: both terms must match. This is also the default between adjacent terms.timeout AND service:chalkruntime
ORUnion: either term can match.service:chalkruntime OR service:api
NOTExclusion: the following term or group must not match.service:api NOT severity:ERROR
-Short exclusion syntax.service:api -severity:ERROR

A term without a field is matched against the record’s message as a substring, so timeout also finds timeouts and connection_timeout_ms. Quotes are required to search a multi-word phrase.

Search syntaxDescription
timeoutSearches message text for timeout.
"request failed"Searches message text for the phrase request failed.
timeout errorSearches message text for both timeout and error.
timeout OR errorSearches message text for either timeout or error.
timeout and errorSearches for all three words. Lowercase and is a term, not an operator.
"AND"Searches for the literal word AND. Unquoted, it parses as the operator.

To search a specific log field, use field:value.

service:chalkruntime
severity:ERROR
resolver:my_resolver

Unlike a message term, a field value must match exactly unless it contains a wildcard. The available fields depend on which explorer you are in; the Logs fields are:

FieldDescription
serviceService name. Also accepts service_name and ServiceName.
componentKubernetes or Chalk component.
severityTRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL, FATAL. Case-insensitive, and warn and information are folded into their canonical spellings.
resolverResolver name or FQN. Also accepts resolver_fqn.
query_nameNamed query.
operation_idOperation ID.
correlation_idCorrelation ID.
pod_nameKubernetes pod name.
appKubernetes app label.
resource_groupResource group.
deployment_idDeployment ID. Also accepts deployment.
scaling_groupScaling group label.
container_nameFilter only. Container label.
http_pathRequest path, for services behind the proxy.
response_code_class2xx, 4xx, 5xx — the response code bucketed by its first digit.
user_loggertrue for logs your resolvers emitted, false for Chalk’s own.
trace_idTrace ID.
workflow_execution_idWorkflow execution ID.

Fields that contain punctuation can be quoted:

"k8s.pod.name":engine-grpc

Wildcards

* in a field value matches any run of characters:

Search syntaxMatches
pod_name:engine-*Values beginning with engine-.
pod_name:*abcdefValues ending with abcdef.
http_path:*VolumeService*Values containing VolumeService.

Grouped Field Values

Put parentheses after a field name to apply that field to every unqualified value in the group.

service:(chalkruntime OR engine-grpc-mcyfr4j8u134)

The query above is equivalent to:

service:chalkruntime OR service:engine-grpc-mcyfr4j8u134

Groups can be nested and can include NOT:

service:((chalkruntime OR "engine grpc") AND NOT (proxy OR api))

If a grouped value has its own field, Chalk keeps that explicit field:

service:(chalkruntime OR component:api)

Grouping And Precedence

Use parentheses to control evaluation order:

(service:chalkruntime OR service:api) AND severity:ERROR

Without parentheses, the precedence order is:

  1. NOT and -
  2. AND and adjacent terms
  3. OR

For example:

"timeout" OR service:api AND NOT severity:ERROR

is evaluated as:

"timeout" OR (service:api AND NOT severity:ERROR)

Special Characters And Spaces

Use double quotes when a value contains spaces, colons, parentheses, or other punctuation:

message:"key:value"
resource_name:"hello world"
service:"engine grpc"

Inside a quoted value, escape a double quote with a backslash:

message:"failed with \"permission denied\""

Examples

Search queryDescription
service:chalkruntime severity:ERRORError logs from chalkruntime.
service:(chalkruntime OR api) -severity:INFOLogs from either service, excluding routine ones.
resolver:my_resolver "timed out"Resolver logs whose message contains timed out.
(component:engine OR component:api) AND severity:ERRORError logs from either component.
service:(NOT (proxy OR api)) timeoutLogs containing timeout from services other than proxy or api.
pod_name:engine-* severity:ERRORError logs from any pod whose name starts with engine-.

Fields By Surface

Every explorer (Logs, Access Logs, Kube Events, Spans, and Traces) accepts the syntax above. What differs between them is the useful attributes to query by.

Most fields can also be a group by dimension in Search Aggregations. Where a field cannot, its description says Filter only. The numeric measures — duration and count — are the exception: they are what the aggregation row measures rather than groups by, so they appear there as fields for Mean, Percentile and the rest.

Access Logs

FieldDescription
authorityTarget host, from the :authority header.
http_pathRequest path. Also accepts path.
methodHTTP method, such as GET or POST.
status_codeHTTP response code. Also accepts response_code.
grpc_statusStatus name, not the numeric code: OK, NOT_FOUND, UNAVAILABLE, and so on.
response_flagsHow Envoy terminated the request: - when nothing went wrong, else a code such as UH, UF or UT.
upstream_hostIP address:port the request was proxied to, so this identifies the receiving pod.
downstream_remote_addressIP address:port the request arrived from. The port is ephemeral, so match on the address with *.
scaling_groupScaling group label. Also accepts scaling_group_name.
containerContainer label. Also accepts container_name.
pod_nameKubernetes pod name.
durationRequest duration, in milliseconds. The numeric measure the aggregation row offers for this surface.
trace_idFilter only. Trace ID, to pivot from a request to its spans.
min_durationFilter only. Lower bound on duration. A bare number is milliseconds; us, ms, s and m also work.
max_durationFilter only. Upper bound on duration, same units as min_duration.

Spans and Traces

Both views filter the same spans over the fields below. Only the Spans view offers the aggregation row, so on Traces every field here is filter-only.

FieldDescription
operationSpan name, such as a resolver or RPC name.
serviceService that emitted the span, which for a client span is the caller rather than the callee.
status_codeSpan status: Ok, Error, or Unset.
kindSpan kind, such as Server, Client, or Internal.
traceTrace ID. Groupable, so grouping by it counts how many spans each trace has.
durationSpan duration, in nanoseconds. The numeric measure the aggregation row offers for this surface.
spanFilter only. Span ID, to pull up one span and its children.
min_durationFilter only. Lower bound on duration. A bare number is microseconds; us, ms, s and m also work.
max_durationFilter only. Upper bound on duration, same units as min_duration.
attrFilter only. Span attribute, written attr:key=value.
resource_attrFilter only. Resource attribute, written resource_attr:key=value.

Kube Events

FieldDescription
severityINFO, WARNING or ERROR — Chalk’s level, derived from the event rather than reported by it.
reasonKubernetes event reason, such as Unhealthy or FailedScheduling.
nameName of the object the event concerns, such as a pod or node name.
kindKind of that object, such as Pod or Node.
namespaceNamespace the object lives in.
cluster_nameCluster the event came from, for an environment spanning more than one.
source_componentComponent that reported the event, such as kubelet.
event_typeKubernetes’ own type, such as Warning, DiskPressure or Disruption.
countOccurrences Kubernetes coalesced into one event. The numeric measure the aggregation row offers here.
pod_nameFilter only. Pod name — name narrowed to objects of kind Pod.
messageFilter only. Substring match against the event message.

Aggregations

Filtering queries can be combined with aggregations, to summarize data rather than list matching records. For more information, see Search Aggregations.