İçeriğe geç
Docs Try Aspire
Docs Try

Search and filter telemetry data in the Aspire CLI

Bu içerik henüz dilinizde mevcut değil.

The --search option filters output by matching against text and attributes on returned data. Search is supported by these commands:

For example, to filter console logs for a specific resource by text:

Aspire CLI
aspire logs redis --search "timeout"

Search queries support free-text fragments, field qualifiers, attribute qualifiers, negation, and comparison operators.

SyntaxMeaningExample
wordFree-text fragment — must appear in at least one searchable fieldtimeout
"quoted phrase"Single fragment containing spaces"connection refused"
field:valueField qualifier — value must match the named fieldseverity:error
field:"value with spaces"Quoted field qualifier valuemessage:"connection failed"
@attr:valueAttribute qualifier — matches custom span/log attributes@http.method:GET
-field:value / -@attr:valueNegated qualifier — excludes matches-severity:debug
field:>N / field:>=N / field:<N / field:<=NNumeric comparisonduration:>100

All terms are AND’d: every fragment and qualifier must independently match.

Matches against log line text content and resource name. Only free-text is supported (no structured qualifiers).

Aspire CLI
aspire logs redis --search "timeout"
aspire logs --follow --search "\"connection error\""

Supports free-text and structured qualifiers. Free-text matches against message, resource name, scope, trace/span IDs, severity, and all attribute keys/values.

Available field qualifiers: severity, resource, scope, message, trace-id, span-id, event.

Aspire CLI
aspire otel logs --search "severity:error \"connection failed\""
aspire otel logs --search "resource:api -severity:debug"
aspire otel logs --search "scope:Microsoft.EntityFrameworkCore"

Supports free-text and structured qualifiers. Free-text matches against trace name, resource name, and all span fields within the trace.

Available field qualifiers: name, resource, trace-id, status, duration.

Aspire CLI
aspire otel traces --search "checkout"
aspire otel traces --search "status:error duration:>500"
aspire otel traces --search "@http.status_code:500"

Supports free-text and structured qualifiers. Free-text matches against span name, resource name, scope, trace/span IDs, status, kind, and all attribute keys/values.

Available field qualifiers: name, resource, scope, status, kind, trace-id, span-id, duration.

Aspire CLI
aspire otel spans --search "@http.method:GET duration:>100 status:error"
aspire otel spans --search "@db.system:postgresql"
aspire otel spans --search "-kind:internal"