> 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/xql-command-reference-guide/readme/stages/stages-list.md).

# Stages list

The following table lists all available XQL pipeline stages:

| Stage                                                                                                              | Description                                                                                      |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| [`alter`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/alter.md)             | Manipulate data by changing existing field values or creating new fields                         |
| [`arrayexpand`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/arrayexpand.md) | Expand an array field into multiple rows                                                         |
| [`bin`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/bin.md)                 | Group numeric values into bins                                                                   |
| [`call`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/call.md)               | Call a saved XQL query                                                                           |
| [`comp`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/comp.md)               | Aggregate data using grouping and aggregate functions                                            |
| [`config`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/config.md)           | Configure query settings                                                                         |
| [`dataset`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/dataset.md)         | Specify the dataset to query                                                                     |
| [`dedup`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/dedup.md)             | Remove duplicate rows                                                                            |
| [`fields`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/fields.md)           | Select or exclude specific fields                                                                |
| [`filter`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/filter.md)           | Filter rows based on a condition                                                                 |
| [`iploc`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/iploc.md)             | Enrich IP addresses with geolocation data                                                        |
| [`join`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/join.md)               | Join two datasets                                                                                |
| [`limit`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/limit.md)             | Limit the number of rows returned                                                                |
| [`pivot`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/pivot.md)             | Rotate row-level data into columns using aggregate functions                                     |
| [`preset`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/presets.md)          | Apply preset configurations                                                                      |
| [`replacenull`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/replacenull.md) | Replace null values with a specified value                                                       |
| [`search`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/search.md)           | Search for records matching a text query                                                         |
| [`sort`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/sort.md)               | Sort rows by one or more fields                                                                  |
| [`switch`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/switch.md)           | Apply different field selections to events based on conditions                                   |
| [`tag`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/tag.md)                 | Add tags to query results                                                                        |
| [`target`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/target.md)           | Specify the target output for query results                                                      |
| [`top`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/top.md)                 | Return the top N rows by a specified field                                                       |
| [`transaction`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/transaction.md) | Group events into transactions                                                                   |
| [`transpose`](https://github.com/jrosenpanw/doc_a/blob/main/Cortex_XQL_Command_Reference/Q4/transpose.md)          | Transpose rows into columns                                                                      |
| [`union`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/union.md)             | Combine the results of two or more queries                                                       |
| [`view`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/view.md)               | Query a saved view                                                                               |
| [`windowcomp`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/windowcomp.md)   | Perform analytic (window) functions over a defined window of rows without collapsing the dataset |

| Stage                                                                                                              | Description                                                                                      |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| [`alter`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/alter.md)             | Manipulate data by changing existing field values or creating new fields                         |
| [`arrayexpand`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/arrayexpand.md) | Expand an array field into multiple rows                                                         |
| [`bin`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/bin.md)                 | Group numeric values into bins                                                                   |
| [`call`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/call.md)               | Call a saved XQL query                                                                           |
| [`comp`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/comp.md)               | Aggregate data using grouping and aggregate functions                                            |
| [`config`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/config.md)           | Configure query settings                                                                         |
| [`dataset`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/dataset.md)         | Specify the dataset to query                                                                     |
| [`dedup`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/dedup.md)             | Remove duplicate rows                                                                            |
| [`fields`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/fields.md)           | Select or exclude specific fields                                                                |
| [`filter`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/filter.md)           | Filter rows based on a condition                                                                 |
| [`iploc`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/iploc.md)             | Enrich IP addresses with geolocation data                                                        |
| [`join`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/join.md)               | Join two datasets                                                                                |
| [`limit`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/limit.md)             | Limit the number of rows returned                                                                |
| [`pivot`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/pivot.md)             | Rotate row-level data into columns using aggregate functions                                     |
| [`preset`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/presets.md)          | Apply preset configurations                                                                      |
| [`replacenull`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/replacenull.md) | Replace null values with a specified value                                                       |
| [`search`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/search.md)           | Perform free-text searches across ingested data                                                  |
| [`sort`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/sort.md)               | Sort rows by one or more fields                                                                  |
| [`switch`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/switch.md)           | Apply different field selections to events based on conditions                                   |
| [`tag`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/tag.md)                 | Add tags to query results                                                                        |
| [`target`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/target.md)           | Specify the target output for query results                                                      |
| [`top`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/top.md)                 | Return the top N rows by a specified field                                                       |
| [`transaction`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/transaction.md) | Group events into transactions                                                                   |
| [`transpose`](https://github.com/jrosenpanw/doc_a/blob/main/Cortex_XQL_Command_Reference/Q4/transpose.md)          | Transpose rows into columns                                                                      |
| [`union`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/union.md)             | Combine the results of two or more queries                                                       |
| [`view`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/view.md)               | Query a saved view                                                                               |
| [`windowcomp`](https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/windowcomp.md)   | Perform analytic (window) functions over a defined window of rows without collapsing the dataset |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/xql-command-reference-guide/readme/stages/stages-list.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
