Skip to main content

dataset

Description

Return the name of the dataset that a record originated from, such as logs or spans.

This is especially useful when a query combines records from more than one dataset — for example with `union` or `join` — and you need to know which dataset each record came from.

Note

To learn how datasets and dataspaces work, see `source`.

Syntax

dataset(): string

Example

Use case: Tag each record with its source dataset

Add the originating dataset name to every record so you can tell where it came from after combining data from multiple sources.

Example data

{
"service": "backend-service",
"status_code": 500
}

Example query

source logs
| limit 1
| create dataset from dataset()

Example output

{
"service": "backend-service",
"status_code": 500,
"dataset": "logs"
}
Last updated on
On this page
Was this page helpful?