Skip to main content

Slow Logs Reference

Use this reference to check a slow request’s duration, result, and execution context. It covers JSON, Elastic Common Schema (ECS), and OpenTelemetry (OTel) output. To set the threshold and destination, see Configure Slow Logs.

Log formats​

For HTTPS forwarding, all three formats use newline-delimited JSON (NDJSON): one log entry per line. Parse each line as a JSON object, then read the record according to the selected format.

FormatWhere to find the log fields
JSONRead fields directly from the object, such as params.execution_time.
ECSRead standard fields such as event.duration. The full original record is an object at zilliz.original.
OTelRead timeUnixNano and attributes. Parse body.stringValue as JSON to access the original record.

Log fields​

The tables below describe fields in the original JSON record. In ECS output, these fields are nested under zilliz.original; for example, params.execution_time becomes zilliz.original.params.execution_time. In OTel output, parse body.stringValue as JSON to read the same fields.

Execution time and result​

FieldJSON typeDescription
params.execution_timestringRecorded execution time, including its unit. The example records 1.802601ms. Compare the duration with the configured threshold using the same unit.
statusstringHuman-readable request status. The example is Success: a request can succeed and still qualify for slow logging.
error_codeintegerRequest result code. The successful request in the example records 0.

Request context​

FieldJSON typeDescription
actionstringOperation name, such as Search. Slow logging covers Search, HybridSearch, and Query.
timestampintegerTime of the logged request, as a Unix timestamp in milliseconds.
cluster_idstringIdentifier of the cluster that handled the request.
databasestringDatabase accessed by the request.
log_typestringLog category. The value is SLOW.
userstringIdentity that issued the request, such as a user name or API key identifier.
interfacestringInterface used for the request. The example uses the REST API and records Restful.
ipstringSource IP address recorded for the request.
trace_idstringTrace identifier associated with the request, useful for correlation and troubleshooting.

Operation parameters​

FieldJSON typeDescription
params.collectionstringName of the collection searched.
params.nqintegerNumber of query vectors. The example contains one vector.
params.output_fieldsarray of stringsEntity fields requested in the response. These are collection fields, not the fields selected for a log record.
params.consistency_levelintegerNumeric consistency-level value recorded for the request. The example records 2.
params.partitionnull in this examplePartition selection recorded for the request. No partition was specified in this request, so the value is null.

Format mappings​

Use these mappings to locate common fields in each format. In the OTel column, all names except timeUnixNano are keys in the attributes array. String attributes use value.stringValue.

FieldJSONECSOTel
Timetimestamp — milliseconds@timestamp — UTC date-timetimeUnixNano — nanoseconds as a string
Durationparams.execution_time — string with a unitevent.duration — nanoseconds as a numberevent.duration — nanoseconds in value.intValue (string)
Operationactionevent.actionevent.action
Calleruseruser.nameuser.name
Clustercluster_idzilliz.original.cluster_idzilliz.cluster.id
Log typelog_type = SLOWevent.dataset = zilliz.milvus.slowzilliz.log.type = SLOW
Outcomestatus = Successevent.outcome = successevent.outcome = success
Client addressipsource.ipsource.address
Tracetrace_idtrace.idtrace.id

Collection details, request parameters, and error codes remain in the original record; they are not expanded into individual fields in the mappings above. The outcome mapping shown here is from successful requests.

Examples​

The following complete records come from actual HTTPS deliveries. Identity values have been replaced; other fields and values are unchanged. Line breaks and indentation are added for readability. A temporary 1 ms threshold was used to collect these slow logs.

JSON example​

This successful Search request took 1.802601ms, exceeding the temporary 1 ms threshold.

json
{
"action": "Search",
"cluster_id": "in01-example",
"database": "default",
"error_code": 0,
"interface": "Restful",
"ip": "192.0.2.10",
"log_type": "SLOW",
"params": {
"collection": "docs_log_sample_20261110",
"consistency_level": 2,
"execution_time": "1.802601ms",
"nq": 1,
"output_fields": [
"primary_key"
],
"partition": null
},
"status": "Success",
"timestamp": 1794300563698,
"trace_id": "0123456789abcdef0123456789abcdef",
"user": "key-example"
}

ECS example​

This Search record declares ECS version 8.11.0. Standard fields appear alongside the full record in zilliz.original.

json
{
"@timestamp": "2026-11-10T09:23:25.97Z",
"ecs": {
"version": "8.11.0"
},
"event": {
"action": "Search",
"category": [
"database"
],
"dataset": "zilliz.milvus.slow",
"duration": 4868781,
"kind": "event",
"outcome": "success",
"type": [
"access"
]
},
"source": {
"ip": "192.0.2.10"
},
"trace": {
"id": "0123456789abcdef0123456789abcdef"
},
"user": {
"name": "key-example"
},
"zilliz": {
"original": {
"action": "Search",
"cluster_id": "in01-example",
"database": "default",
"error_code": 0,
"interface": "Restful",
"ip": "192.0.2.10",
"log_type": "SLOW",
"params": {
"collection": "docs_log_sample_20261110",
"consistency_level": 2,
"execution_time": "4.868781ms",
"nq": 1,
"output_fields": [
"primary_key"
],
"partition": null
},
"status": "Success",
"timestamp": 1794302605970,
"trace_id": "0123456789abcdef0123456789abcdef",
"user": "key-example"
}
}
}

OTel example​

This Search record contains the original JSON as an escaped string in body.stringValue, alongside mapped attributes. Each NDJSON line is an individual log record, without a resourceLogs envelope.

json
{
"timeUnixNano": "1794302922142000000",
"body": {
"stringValue": "{\"action\":\"Search\",\"cluster_id\":\"in01-example\",\"database\":\"default\",\"error_code\":0,\"interface\":\"Restful\",\"ip\":\"192.0.2.10\",\"log_type\":\"SLOW\",\"params\":{\"collection\":\"docs_log_sample_20261110\",\"consistency_level\":2,\"execution_time\":\"1.579877ms\",\"nq\":1,\"output_fields\":[\"primary_key\"],\"partition\":null},\"status\":\"Success\",\"timestamp\":1794302922142,\"trace_id\":\"0123456789abcdef0123456789abcdef\",\"user\":\"key-example\"}"
},
"attributes": [
{
"key": "zilliz.cluster.id",
"value": {
"stringValue": "in01-example"
}
},
{
"key": "zilliz.log.type",
"value": {
"stringValue": "SLOW"
}
},
{
"key": "user.name",
"value": {
"stringValue": "key-example"
}
},
{
"key": "source.address",
"value": {
"stringValue": "192.0.2.10"
}
},
{
"key": "event.action",
"value": {
"stringValue": "Search"
}
},
{
"key": "event.outcome",
"value": {
"stringValue": "success"
}
},
{
"key": "trace.id",
"value": {
"stringValue": "0123456789abcdef0123456789abcdef"
}
},
{
"key": "event.duration",
"value": {
"intValue": "1579877"
}
}
]
}

When reading timeUnixNano or value.intValue, preserve integer precision. For example, use BigInt for nanosecond timestamps in JavaScript.