> 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-xdr-3.x/cortex-xdr-3.x-documentation/cortex-xdr-xql/build-xql-queries/manage-your-personal-query-library.md).

# Manage your personal query library

{% hint style="info" %}

### Notice

Building Cortex Query Language (XQL) queries in the Query Builder requires a Cortex XDR Pro license.
{% endhint %}

Cortex XDR provides as part of the Query Library a personal query library for saving and managing your own queries. When creating a query in XQL Search or managing your queries from the Query Center, you can save queries to your personal library. You can also decide whether the query is shared with others (on the same tenant) in their Query Library or unshare it, so it is only visible to you. You can also view the queries that are shared by others (on the same tenant) in your Query Library.

The queries listed in your Query Library have different icons to help you identify the different states of the queries:

* ![unshared-query-icon.png](/files/ejJ8qDnJN1r3YotF2lmt)Created by me and unshared.
* ![query-created-by-me-shared-icon.png](/files/JpMolOppK47pQGA3bsgS)Create by me and shared.
* ![query-created-by-someone-else-shared.png](/files/hdtBRmaRgK4qnn75fDnp)Created by someone else and shared.

The Query Library contains a powerful search mechanism that enables you to search in any field related to the query, such as the query name, description, creator, query text, and labels. In addition, adding a label to your query enables you to search for these queries using these labels in the Query Library.

### How to add a query to your personal query library

1. Save a query to your personal query library.

   You can do this in two ways.

   * **From XQL Search**
     1. Select **Incident Response** → **Investigation** → **Query Builder** → **XQL Search**.
     2. In the XQL query field, define the parameters of your query.
     3. Select **Save as** → **Query to Library**.
   * **From the Query Center**
     1. Select **Incident Response** → **Investigation** → **Query Center**.
     2. Locate the query that you want to save to your personal query library.
     3. Right-click anywhere in the query row, and select **Save query to library**.
2. Set these parameters.
   * **Query Name**: Specify a unique name for the query. Query names must be unique in both private and shared lists, which includes other people’s queries.
   * **Query Description** (Optional): Specify a descriptive name for your query.
   * **Labels** (Optional): Specify a label that is associated with your query. You can select a label from the list of predefined labels or add your label and then select **Create Label**. Adding a label to your query enables you to search for queries using this label in the Query Library.
   * **Share with others**: You can either set the query to be private and only accessible by you (default) or move the toggle to **Share with others** the query, so that other users using the same tenant can access the query in their Query Library.
3. Click **Save**.

   A notification appears confirming that the query was saved successfully to the library, and closes on its own after a few seconds.

   The query that you added is now listed as the first entry in the **Query Library**. The query editor is opened to the right of the query.
4. Other available options.

   As needed, you can return to your queries in the **Query Library** to manage your queries. Here are the actions available to you.

   * Edit the name, description, labels, and parameters of your query by selecting the query from the **Query Library**, hovering over the line in the query editor that you want to edit, and selecting the edit icon to edit the text.
   * **Search query data and metadata**: Use the Query Library’s powerful search mechanism that enables you to search in any field related to the query, such as the query name, description, creator, query text, and label. The **Search query data and metadata** field is available at the top of your list of queries in the **Query Library**.
   * **Show**: Filter the list of queries from the **Show** menu. You can filter by the **Palo Alto Networks** queries provided with Cortex XDR , filter by the queries **Created by Me**, or filter by the queries **Created by Others**. To view the entire list, **Select all** (default).
   * **Save as new**: Duplicate the query and save it as a new query. This action is available from the query menu by selecting the 3 vertical dots.
   * **Share with others**: If your query is currently unshared, you can share with other users on the same tenant your query, which will be available in their Query Library. This action is only available from the query menu by selecting the 3 vertical dots when your query is unshared.
   * **Unshare**: If your query is currently shared with other users, you can **Unshare** the query and remove it from their Query Library. This action is only available from the query menu by selecting the 3 vertical dots when your query is shared with others. You can only **Unshare** a query that you created. If another user created the query, this option is disabled in the query menu.
   * **Delete** the query. You can only delete queries that you created. If another user created the query, this option is disabled in the query menu when selecting the 3 vertical dots.


---

# 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-xdr-3.x/cortex-xdr-3.x-documentation/cortex-xdr-xql/build-xql-queries/manage-your-personal-query-library.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.
