Programmable Push Filters
You can use Redpanda Console’s programmable push filters to search for a specific message within a Kafka topic.
every individual Kafka record. The code has to return a boolean. If your code returns
true, the backend sends the record to the frontend.
Otherwise the record will be skipped and Redpanda Console will continue to consume records until the selected number
of max search results has been reached or "the end" of the topic hit.
Redpanda Console injects the following variables into your function, which you can use in your filter code:
partitionId- the record’s partition ID
offset- the record’s offset within its' partition
key- the record’s key in its decoded form
value- the record’s value in its decoded form
If you have a series of Avro, JSON or Protobuf encoded record values which deserialize to JSON objects like this:
return value.item.id == "895e443a-f1b7-4fe5-ad66-b9adfe5420b9"
Redpanda Console allows you to use more than one filter function at the same time. If you start a search while having multiple filters active, they are combined with a logical OR. Accordingly, as soon as one function returns true, the record will be sent to the frontend.
You can use Redpanda Console’s filter engine against topics with millions of messages, as the filter code is evaluated in the backend where more resources are available. However, while the filter engine is fairly efficient it will potentially consume all available CPU resources and may cause significant network traffic due to the number of consumed Kafka messages.