dataset
Use the dataset stage to explicitly define the data table your XQL query will retrieve records from. This is a fundamental component used to specify the data source and is crucial for query optimization.
Syntax
dataset [=] <dataset_name>
dataset in (<dataset_name1>, <dataset_name2>, ...)
cold_dataset = <dataset_name>Parameters
dataset_name
string
Yes
The name of the dataset to query. If omitted, the query defaults to xdr_data.
in
operator
No
An operator used to specify a list of multiple datasets to query simultaneously.
Returns
The dataset stage returns raw records and all available fields from the specified data source(s).
Usage notes
The
datasetstage must always be the very first stage in your XQL query, unless it is preceded by aconfigstage.If you do not explicitly define a dataset, Cortex XDR/XSIAM will default to querying the
xdr_datadataset.Dataset names in queries are always treated as if they are lowercase, even if you type them with uppercase characters (Case Insensitivity).
Specifying the dataset early is a best practice for streamlining queries, as it helps reduce the amount of data processed.
The
cold_datasetsyntax is used specifically for querying data stored in cold storage.
Examples
Example 1: Basic Dataset Specification
Goal: Explicitly specify a single data source for the query.
XQL code:
Explanation: This query retrieves all available fields from the sample_xql_raw dataset within the specified timeframe.
Output:
101
2023-10-26 10:00:00 UTC
"User login successful"
102
2023-10-26 10:05:30 UTC
"File access attempt"
103
2023-10-26 10:15:15 UTC
"Network connection established"
104
2023-10-26 10:20:00 UTC
"System heartbeat"
105
2023-10-26 10:30:45 UTC
"Data transformation"
Example 2: Specifying Multiple Datasets
Goal: Query across several different datasets using the in operator.
XQL code:
Explanation: This query demonstrates the dataset in syntax. While sample_xql_raw is a single dataset, this syntax allows listing multiple datasets (for example, dataset in ("dataset1", "dataset2")) to aggregate results from multiple sources.
Output:
101
"User login successful"
true
103
"Network connection established"
true
104
"System heartbeat"
true
105
"Data transformation"
true
107
"Cloud resource modification"
true
Example 3: cold_dataset Note (conceptual example)
Goal: Query data that is stored in cold storage.
XQL code:
Explanation: The cold_dataset = <dataset name> syntax is used specifically for querying data stored in cold storage. This example conceptually queries a cold dataset named sample_xql_raw_cold.
Output:
101
2023-10-26 10:00:00 UTC
"User login successful"
102
2023-10-26 10:05:30 UTC
"File access attempt"
103
2023-10-26 10:15:15 UTC
"Network connection established"
Example 4: Default dataset (xdr_data)
Goal: Implicitly query the default dataset (xdr_data) by omitting the dataset stage.
XQL code:
Explanation: If no dataset stage is explicitly defined, XQL queries automatically run against the xdr_data dataset. This example directly filters and selects fields, implicitly targeting the default dataset (represented here by sample_xql_raw data for context).
Output:
101
"User login successful"
Related articles
Datasets:
xdr_data
Last updated
Was this helpful?
