# Searching for messages

## Examining a message

After selecting a topic you will be shown more details of the topic. The SQL Snapshot engine will return to you 200 of the latest messages for partition 0. Both the key and value of the message are displayed in a tree format which is expandable.

At the top of each message, the Kafka metadata (partition, timestamp, offset) is displayed.

Hovering to the right allows you a message the clipboard.

{% code overflow="wrap" %}

```json
{ "key": { "MMSI": 219347000 }, "value": { "Type": 1, "Repeat": 0, "MMSI": 219347000, "Speed": 0, "Accuracy": true, "Longitude": "9.747901666666667", "Latitude": 59.006915, "location": "59.006915,9.747902", "Course": 141.1, "Heading": 511, "Second": 14, "RAIM": true, "Radio": 23096, "Status": 0, "Turn": -128, "Maneuver": 0, "Timestamp": "1491318149612948547" } }
```

{% endcode %}

To download all messages to JSON or CSV see [here](/latest/devx/6.1/user-guide/topics/environment-topic-catalogue/downloading-messages.md).

### Flattening the data view

The SQL Snapshot engine deserializes the data on the backend of Lenses and sends it over the WebSocket to the client. By default, the data is presented in a tree format but it's also possible to flatten the data into a grid view. Select the grid icon.

## Searching by partition

Use the partition drop-down to change the partition to return messages you are interested in.

## Searching by timestamp

Use the timestamp picker to search for messages from a timestamp.

## Searching by offset

Use the offset select to search for messages from an offset.

## Live sample

The SQL Snapshot engine has a live mode. In this mode the engine will return a sample of messages matching the query. To enable this, select the `Live Sample` button. The data view will now update with live records as the are written to the topic. You can also edit the query if required.

{% hint style="info" %}
This is sample data, not the full set to avoid overloading the browser
{% endhint %}

## Changing the SQL deserializer format

For the SQL Snapshot engine to return data it needs to understand the format of the data in a topic. If a topic is backed by a Schema registry it is automatically set to AVRO. For other types, such as JSON or Strings the engine tries to determine the format.

If you wish to override or correct the format used select either **Reset Types** or **Change Type**s from the action menu.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/devx/6.1/user-guide/topics/environment-topic-catalogue/searching-for-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
