Event format
streamview keeps each event in the CloudEvents JSON format. Each event is one JSON object. If your data is not in this format, streamview makes the event. The last sections of this page tell you how, for each source.
Necessary fields
Section titled “Necessary fields”| Field | Type | What streamview does with it |
|---|---|---|
id |
Text | Identifies the event, together with source. |
source |
Text | Identifies the event, together with id. |
type |
Text | Gives the channel, together with broker and channel. Events that have the same values for these three fields are in one lane. |
If a JSON object does not have these three fields, streamview serve and POST /events make an event from it.
See Events from plain JSON records.
An object that has a specversion field must have these three fields. If it does not, streamview rejects it.
The value of specversion is not important to streamview.
Optional fields
Section titled “Optional fields”| Field | What streamview does with it |
|---|---|
time |
Puts the event at this time. The format is RFC 3339. If there is no time, or streamview cannot read it, streamview uses the arrival time. If the time is more than 5 minutes after the current time, streamview also uses the arrival time. |
broker |
Shows the icon for kafka, nats, rabbitmq, webhook, sns, sqs, or eventbridge. Other values get a general icon. |
icon |
Gives the lane of the event an icon of your own. See The icon of a lane. |
channel |
Shows the name of the topic, queue, or bus. The same type on two topics gives two lanes. |
correlationid |
Connects the event to the other events of the same order. |
traceparent |
Connects events by trace ID, if there is no correlationid. |
data |
Gives the fields that you can filter by, and the shape that streamview compares. |
streamview keeps all other fields. The event panel shows the full event.
The icon of a lane
Section titled “The icon of a lane”A lane shows the icon of its broker. An event can ask for a different icon with the icon attribute.
The value is one of these:
| Value | Example | What the lane shows |
|---|---|---|
| One or two characters | "🪵" or "DB" |
The characters. An emoji is the simplest icon. The maximum is 12 characters. |
| The name of an icon of the page | "kafka" |
The icon for kafka, nats, rabbitmq, webhook, sns, sqs, or eventbridge. |
| The address of an image | "https://example.com/logo.svg" |
The image. The address starts with https:// or http://. |
| An image in the value itself | "data:image/svg+xml,..." |
The image. The value starts with data:image/, and the maximum is 60,000 characters. |
{"specversion":"1.0","id":"1","source":"/agent","type":"agent.log","icon":"🪵","data":{"line":"started"}}- The icon is for the lane, not for one event. It is sufficient that the first event of a lane has the attribute.
- If a later event of the lane asks for a different icon, the lane gets that icon.
- streamview ignores a value that is not in the table. The lane then keeps the icon that it had.
- If an image does not load, the lane shows the general icon.
There are three more ways to give an icon:
--icon VALUEgives an icon to each lane whose events do not ask for one. The value can also be an image file on your computer. See Command line.--icon-field NAMEgives the field of a plain JSON record that has the icon.?icon=VALUEin the address of a webhook gives an icon to the lanes of that webhook.
Duplicate events
Section titled “Duplicate events”streamview ignores an event if it already has an event with the same source and id.
Fields in data
Section titled “Fields in data”The search box has a filter for a field in data if all these conditions are true:
- The value is text or a boolean.
- The text is 48 characters or shorter.
- The field has 24 different values or fewer in its channel.
- The channel has fewer than 16 such fields.
For all other values, add a filter from the JSON of an event. The server has an index for them. See Limits.
streamview learns the usual shape of data from the first 20 events of each channel.
See Flagged events.
Events from Kafka messages
Section titled “Events from Kafka messages”A Kafka message can contain a CloudEvent in two ways. The adapter reads the two ways.
- Structured mode. The value of the message is the full CloudEvent as JSON. The adapter keeps it.
- Binary mode. The headers of the message contain the fields, with the names
ce_specversion,ce_id,ce_source, andce_type. The adapter makes the event from all headers that start withce_. The value of the message becomesdata. Thecontent-typeheader becomesdatacontenttype.
The adapter adds broker and channel, if the event does not have them.
If the message has a key, the adapter adds it as partitionkey.
For a binary-mode event that has no ce_time header, the adapter uses the timestamp of the message.
If the value is not a CloudEvent, the adapter makes this event:
| Field | Value |
|---|---|
specversion |
1.0 |
id |
The topic, the partition, and the offset, for example orders.placed-0-1523. |
source |
kafka:// and the topic. |
type |
The --type-prefix text and the topic. |
time |
The timestamp of the message. |
broker |
kafka |
channel |
The topic. |
partitionkey |
The key of the message, if there is one. |
correlationid |
The first of these that the message has: the value of the --correlation-field field, the correlationid or Correlation-Id header, or the key (only with --correlation-key). |
traceparent |
The traceparent header, if the message has it. |
datacontenttype |
application/json if the value is JSON. If not, text/plain. |
data |
The value of the message. |
Events from NATS messages
Section titled “Events from NATS messages”If the data of a message is a CloudEvent, the adapter keeps it. This is structured mode.
The adapter also reads binary mode: the headers ce-specversion, ce-id, ce-source, and ce-type contain the fields.
The adapter then makes the event from all headers that start with ce-, and the data of the message becomes data.
The adapter adds broker and channel, if the event does not have them.
For a message from a stream, it also adds stream.
If the data is not a CloudEvent, the adapter makes this event:
| Field | Message from a stream | Other message |
|---|---|---|
specversion |
1.0 |
1.0 |
id |
The stream name and the sequence number, for example ORDERS-1523. |
A random text for this start of the adapter, and a counter. |
source |
nats://stream/ and the stream name. |
nats:// and the subject. |
type |
The --type-prefix text and the subject. |
The same. |
subject |
The full subject. | The same. |
time |
The time when the stream stored the message. | The arrival time. |
stream |
The stream name. | Not there. |
broker |
nats |
nats |
channel |
The subject. | The same. |
correlationid |
See below. | The same. |
traceparent |
The traceparent header, if there is one. |
The same. |
datacontenttype |
application/json if the data is JSON. If not, text/plain. |
The same. |
data |
The data of the message. | The same. |
With --depth N, the adapter uses only the first N parts of the subject in source, type, and channel.
The subject field always has the full subject.
The adapter gets correlationid from the first of these that has a value:
- The
--correlation-fieldfield of the data. - The
correlationidheader. - The
Correlation-Idheader.
Events from RabbitMQ messages
Section titled “Events from RabbitMQ messages”If the body of a message is a CloudEvent, the adapter keeps it. This is structured mode.
The adapter also reads binary mode: headers contain the fields specversion, id, source, and type.
The names of these headers start with cloudEvents:, cloudEvents_, ce-, or ce_.
The adapter adds broker and channel, if the event does not have them.
If the message is not a CloudEvent, the adapter makes this event:
| Field | Value |
|---|---|
specversion |
1.0 |
id |
The message_id property. If there is none: a random text for this start of the adapter, and a counter. |
source |
rabbitmq:// and the exchange. |
type |
The --type-prefix text and the routing key. With --depth, only the first parts of the routing key. If there is no routing key, the exchange. |
subject |
The full routing key. |
time |
The arrival time. If the timestamp property is more than 2 seconds different from the arrival time, the adapter uses that property. |
broker |
rabbitmq |
channel |
The exchange. For a message that went directly to a queue: (default exchange). |
correlationid |
The first of these that the message has: the value of the --correlation-field field, the correlation_id property, or the correlationid or Correlation-Id header. |
traceparent |
The traceparent header, if the message has it. |
datacontenttype |
application/json if the body is JSON. If not, the content_type property, or text/plain. |
data |
The body of the message. |
The timestamp property of RabbitMQ has no parts of a second. The arrival time is more accurate for a message that came a moment before.
Events from webhooks
Section titled “Events from webhooks”The server makes these events itself, from the requests to POST /webhooks/NAME.
If the body of a webhook is a CloudEvent, the server keeps it. This is structured mode.
The server also reads binary mode: the headers ce-specversion, ce-id, ce-source, ce-type, and ce-time.
The server adds broker and channel, if the event does not have them.
If the webhook is not a CloudEvent, the server makes this event:
| Field | Value |
|---|---|
specversion |
1.0 |
id |
See the list below. |
source |
/webhooks/ and the name. |
type |
See the list below. |
time |
The arrival time. |
broker |
webhook |
channel |
The name. |
correlationid |
The value of the first correlation field that the body has. The fields come from the correlation-field query parameter, and then from --correlation-field. The value must be a text or a number. |
traceparent |
The traceparent header, if the webhook has it. |
datacontenttype |
application/json, or text/plain if the body is not JSON and not a form. |
data |
The body of the webhook. |
The type is the first of these that the webhook has:
- The value of the
typequery parameter. The server uses it as it is. - The name, a period, and the kind of the event that the service gives.
- The name only.
The server looks for the kind of the event in these places, in this sequence:
- The
X-GitHub-Eventheader. If the body has anactiontext, the server adds a period and that text. - One of these headers:
X-Gitlab-Event,X-Shopify-Topic,X-Event-Key,X-Event-Type,X-Webhook-Event,X-Webhook-Topic,X-Event-Name. - The
typefield of theeventfield of the body, ifeventis an object. - One of these text fields of the body:
type,event_type,eventType,event,event_name,eventName,detail-type,topic,object_kind,action.
The server writes the kind in lowercase. It changes each space to _, and each / and : to a period.
For example, orders/create at /webhooks/shop gives the type shop.orders.create.
The ID is the first of these that the webhook has:
- One of these headers:
webhook-id,svix-id,X-GitHub-Delivery,X-Gitlab-Event-UUID,X-Shopify-Webhook-Id,X-Event-Id,Idempotency-Key. - The
idfield of the body, if theobjectfield of the body isevent. Stripe sends this. wh-, the arrival time, and a counter.
When a service sends a webhook again with the same ID, the server keeps only the first copy.
Events from plain JSON records
Section titled “Events from plain JSON records”A plain JSON record is a JSON object that is not a CloudEvent.
streamview serve makes an event from each plain JSON record in a file or in standard input.
Each server that stores events does the same for POST /events.
One line can have two or more records, one directly after the other.
| Field | Value |
|---|---|
specversion |
1.0 |
id |
rec- and a number that the server calculates from the text of the record. If the record has no time, a second record with the same text gets -1 at the end, and a third gets -2. |
source |
/ and the name of the file. For standard input: /stdin. For POST /events: /events. |
type |
See the list below. |
time |
See the list below. |
correlationid |
The value of the first --correlation-field field that the record has. The value must be a text or a number. |
traceparent |
The traceparent field of the record, if it is a text. |
datacontenttype |
application/json |
data |
The record. |
The event has no broker field and no channel field.
The type is the first of these that the record has:
- The text of
--type. - The value of the first
--type-fieldfield that the record has. The server uses it as it is. - The kind of the event from the body fields that the server reads for a webhook. See Events from webhooks.
- The name of the file, to its first period. For standard input and
POST /events:record.
The time is the first of these that the server can read:
- A
--time-fieldfield. - One of these fields:
time,timestamp,@timestamp,ts,eventTime,event_time,occurred_at,occurredAt. - The arrival time.
The server reads these time formats:
- Text in the RFC 3339 format:
2026-12-01T10:00:00Z. - The same text with no time zone. The server reads it as UTC.
- A number of seconds, milliseconds, microseconds, or nanoseconds from 1970. The size of the number tells the server which unit it is.
- The same number as text.
A record that has a time always gets the same ID. If the server gets the same record again, it ignores the record as a duplicate event. A record that has no time gets the same ID only after the server starts again. Thus two equal lines of a log are two events.