Use our interactive guide to learn how you can use Console filters to find Kafka messages
There are numerous mechanisms to help you drill down into a topic to find specific messages.
By default, the most recent 500 records are displayed from a topic. However, there are multiple filters available for customizing the results displayed in the topic consume view.
|Show From||Time-based or offset-based filter for determining where to start consuming from.|
|Limit||Time-based or offset-based filter for determing where to limit consumption. Choose 'None (live consume)' for live consumer mode.|
|Partitions||Choose all partitions or specific partition(s) to consume from.|
Console provides a powerful mechanism for filtering on the message key and value. From within the topic consume view, select Add filter to create a new custom filter.
Note you have an array of different operators to build your filter conditions. You can also add multiple filters in parallel to facilitate more advanced filtering requirements.
Toggle search in a specific field to directly select a field that is derived from a sample of your messages. Note this function works only on JSON records.
- From within the consumer view, select Add filter and choose advanced from within the filter modal.
Accessing message attributes
Let's imagine we have the following 2 Records in our topic:
"name": "beers pack"
"name": "baby diapers pack"
"name": "shampoo bottle"
Here are some examples of filters related to these records:
return value.totalPrice >= 30;
// Selects all the orders having a total price superior to or equal to 30
return value.items.length > 1;
// Selects all the orders containing more than one 1 item
return value.orderId == 12345;
// Finds a specific order based in its ID
// Selects all the orders that aren't paid
// Selects all the records not having a trace-id header
const isHighPrice = value.totalPrice >= 30
const moreThanOneItem = value.items.lenght > 1
return isHighPrice && moreThanOneItem
// Selects all the orders having a total price superior to or equal to 30 and having more than one 1 item