Creates or replaces a dataset that references a data source in ES|QL data federation.
Dataset names participate in the index namespace and must follow index or alias naming rules.
Returns 404 if the referenced data source does not exist.
Required authorization
- Index privileges:
manage
Query parameters
-
Period to wait for a connection to the master node.
External documentation -
The time to wait for the request to be completed.
External documentation
Body
Required
-
The name of the referenced data source. The data source must already exist.
-
The URI that identifies the data to read, resolved against the referenced data source. It can include glob patterns. For example, a recursive pattern can match all Parquet files under the
s3://logs-bucket/accessprefix. -
A free-text description of the dataset.
-
User-declared mapping on the dataset definition
-
Format and parsing-specific settings that configure how the resource is read. Common keys include
format, which explicitly selects a registered format, andpartition_detection, which acceptsauto,hive,template, ornone. Additional keys depend on the format reader. Compression can be inferred from the resource URI.
PUT /_query/dataset/access_logs
{
"data_source": "prod_s3_logs",
"resource": "s3://logs-bucket/access/**/*.parquet",
"description": "Production access logs",
"settings": {
"partition_detection": "hive"
}
}
resp = client.esql.put_dataset(
name="access_logs",
data_source="prod_s3_logs",
resource="s3://logs-bucket/access/**/*.parquet",
description="Production access logs",
settings={
"partition_detection": "hive"
},
)
const response = await client.esql.putDataset({
name: "access_logs",
data_source: "prod_s3_logs",
resource: "s3://logs-bucket/access/**/*.parquet",
description: "Production access logs",
settings: {
partition_detection: "hive",
},
});
response = client.esql.put_dataset(
name: "access_logs",
body: {
"data_source": "prod_s3_logs",
"resource": "s3://logs-bucket/access/**/*.parquet",
"description": "Production access logs",
"settings": {
"partition_detection": "hive"
}
}
)
$resp = $client->esql()->putDataset([
"name" => "access_logs",
"body" => [
"data_source" => "prod_s3_logs",
"resource" => "s3://logs-bucket/access/**/*.parquet",
"description" => "Production access logs",
"settings" => [
"partition_detection" => "hive",
],
],
]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"data_source":"prod_s3_logs","resource":"s3://logs-bucket/access/**/*.parquet","description":"Production access logs","settings":{"partition_detection":"hive"}}' "$ELASTICSEARCH_URL/_query/dataset/access_logs"
{
"data_source": "prod_s3_logs",
"resource": "s3://logs-bucket/access/**/*.parquet",
"description": "Production access logs",
"settings": {
"partition_detection": "hive"
}
}
{
"acknowledged": true
}