> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-agentix/reference-and-developer-docs/cortex-agentix-xql/get-started-with-xql/xql-language-features.md).

# XQL language features

The Cortex Query Language (XQL) enables you to query for information contained in a wide variety of data sources in Cortex AgentiX for rigorous endpoint and network event analysis. Queries require a dataset, or data source, to run against. In a dataset query, unless otherwise specified, the query runs against the `xdr_data` dataset, which contains all raw log information that Cortex AgentiX collects from all Cortex product agents, including EDR data, and PAN NGFW data. In XDM queries, you must specify the dataset mapped to the XDM that you want to run your query against. For both types of queries, you can also import data from third parties and then query against those datasets as well.

You submit XQL queries to Cortex AgentiX using the **Investigation & Response** → **Search** → **Query Builder** user interface.

XQL is similar to other query languages, and it uses some of the same functions as can be found in many SQL implementations, but it is not SQL. XQL forms queries in stages. Each stage performs a specific query operation and is separated by a pipe (`|`) character. To help you create an eﬀective XQL query with the proper syntax, the query ﬁeld in the user interface provides suggestions and deﬁnitions as you type. For example, the following dataset query uses three stages to identify the dataset to query, identify the field to be retrieved from the dataset, and then set a filter that identifies which records should be retrieved as part of the query:

```programlisting
dataset = xdr_data 
| fields os_actor_process_file_size as osapfs 
| filter to_string(osapfs) = "12345"
```

{% hint style="info" %}

### Tip

When creating XQL queries, you can:

* Use the up and down arrow keys to navigate through the auto-suggestion commands and definitions.
* Select an auto-suggestion command by pressing either the **Enter** or **Tab** key.
* Press **Shift**+**Enter** to add a new line, and easily ignore the auto-suggestion output.
* Close the auto-suggestion output by pressing the **Esc** key.
  {% endhint %}

XQL supports:

* Simple queries.
* Filters that identify a subset of records to return in the result set.
* Joins and Unions.
* Aggregations.
* Queries against standard datasets.
* Queries against presets, which are collections of information that are specific to a given type of network or endpoint activity, such as authentication or file transfers.
* Queries against custom imported datasets.
* Queries against the XDM.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-agentix/reference-and-developer-docs/cortex-agentix-xql/get-started-with-xql/xql-language-features.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
