Skip to content

Search records

POST
/api/v1/clusters/{id}/topics/{topic}/search
curl --request POST \
--url http://localhost:8080/api/v1/clusters/example/topics/example/search \
--header 'Content-Type: application/json' \
--header 'X-Brokerium-Request: 1' \
--cookie brokerium_session=<brokerium_session> \
--data '{ "partitions": [ 1 ], "fromTime": 1, "toTime": 1, "resume": [ { "partition": 1, "offset": 1 } ], "key": { "contains": "example", "regex": "example" }, "value": { "contains": "example", "regex": "example" }, "header": { "key": "example", "value": { "contains": "example", "regex": "example" } }, "ignoreCase": true, "limit": 1, "maxRecords": 1, "timeoutSeconds": 1 }'

Brokerium Enterprise, feature message-tools. Role: viewer. Reads the selected partitions from the start of the time range (or the earliest record) and returns the records that match, sorted by partition and offset. The search stops after limit matches (100 by default, at most 1000), maxRecords records read (a million by default) or timeoutSeconds (30 by default, at most 300); pass next as resume to continue.

id
required
string
topic
required
string
X-Brokerium-Request
required
string
Allowed value: 1

Required on every non-GET request.

Media typeapplication/json
object
partitions

All partitions when empty.

Array<integer>
fromTime

Unix milliseconds, inclusive.

integer format: int64
toTime

Unix milliseconds, exclusive.

integer format: int64
resume

Continues an earlier search from the offsets in its next.

Array<object>
object
partition
integer format: int32
offset
integer format: int64
key

Either a text the bytes contain or a regular expression (RE2 syntax), at most 1024 bytes.

object
contains
string
regex
string
value

Either a text the bytes contain or a regular expression (RE2 syntax), at most 1024 bytes.

object
contains
string
regex
string
header
object
key
required
string
value

Either a text the bytes contain or a regular expression (RE2 syntax), at most 1024 bytes.

object
contains
string
regex
string
ignoreCase
boolean
limit
integer
maxRecords
integer format: int64
timeoutSeconds
integer

Example generated

{
"partitions": [
1
],
"fromTime": 1,
"toTime": 1,
"resume": [
{
"partition": 1,
"offset": 1
}
],
"key": {
"contains": "example",
"regex": "example"
},
"value": {
"contains": "example",
"regex": "example"
},
"header": {
"key": "example",
"value": {
"contains": "example",
"regex": "example"
}
},
"ignoreCase": true,
"limit": 1,
"maxRecords": 1,
"timeoutSeconds": 1
}

Matches and how far the search got.

Media typeapplication/json
object
scanned

Records read.

integer format: int64
next

The first offset not read in each partition.

Array<object>
object
partition
integer format: int32
offset
integer format: int64
complete

Every partition was read to the end of the range.

boolean
stopped

What ended an incomplete search.

string
Allowed values: limit records time
messages
Array<object>
object
partition
integer format: int32
offset
integer format: int64
timestamp
string format: date-time
key
string | null
value
string | null
headers
Array<object>
object
key
required
string
value
required
string
encoding

Omitted for text.

string
Allowed values: utf8 base64
keyEncoding
string
Allowed values: utf8 base64
valueEncoding
string
Allowed values: utf8 base64

Example

{
"stopped": "limit",
"messages": [
{
"headers": [
{
"encoding": "utf8"
}
],
"keyEncoding": "utf8",
"valueEncoding": "utf8"
}
]
}

Error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

Error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

Error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

Apache®, Apache Kafka® and Kafka® are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Brokerium is not affiliated with, endorsed by, or sponsored by the Apache Software Foundation.