> 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/playbook-design-guide/playbook-design-guide/filters-and-transformers/create-filters-and-transformers-in-a-playbook/create-a-filter-advanced-example.md).

# Create a Filter (Advanced) Example

Advanced example of how to create a filter in Cortex XSOAR 6x.

In this example, we want to see the **`LastResolved`** time only from the **`demisto.com`** host name.

This is part of the data where we want to filter:

```programlisting
{
    "IP": [
       {
        "Address": "192.168.10.96",
        "AutoFocus": {
            "Resolutions": [
                {
                    "Hostname": "79463wwfqq,dattolocal.net",
                    "LastResolved": "2022-08-02 04:01:02"
                },
                {
                    "Hostname": "demisto.com",
                    "LastResolved": "2022-09-10 09:47:17"
                },
                {
                    "Hostname": "securesense.call4pchelp.com",
                    "LastResolved": "2022-04-22 11:49:06"
                }
            ]
        }
       },
       {
        "Address":"192.168.10.96",
        "AutoFocus": {
            "Resolutions":[
                {
                    "Hostname":"79463wwfqq,dattolocal.net",
                    "LastResolved":"2022-08-02 04:01:02"
                },
                {
                    "Hostname":"demisto.com",
                    "LastResolved":"2022-09-10 09:47:17"
                },
                {
                    "Hostname":"securesense.call4pchelp.com",
                    "LastResolved":"2022-04-22 11:49:06"
                }
            ]
        }
       }
    ]
}
```

1. From the **Filters & transformers** window, in the **Get** field, type **`IP.AutoFocus.Resolutions.LastResolve`**.

   ![playbook-filter-auto.png](https://3463426153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgaMaDyA7IyU5W44zuyhm%2Fuploads%2Fgit-blob-f31f6490ae76169dca627b8a136bafb09825cf8b%2F4d9571811e5ce25c6d48c1b8aa4a6e954f5a61f8c20e6f02a83d551028d99e1b.png?alt=media)
2. In the **Filter** section, click **Add filter.**

   Cortex XSOAR automatically calculates that the context root to filter is **`IP.AutoFocus.Resolutions`**.

   ![playbook-filter-autores.png](https://3463426153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgaMaDyA7IyU5W44zuyhm%2Fuploads%2Fgit-blob-cf9ef9aca07aa7848db54d5687da4d9659d74a81%2Ff3f7f3091a3676bc7202dd27556a51fee779e86ddc2b63b1b1c14d3ceacb8702.png?alt=media)
3. In the left-hand side, add **`Hostname`** to the filter.
4. Select Equals (String) → **Ends with**
5. In the right-hand side add **`demisto.com`**.
6. Click the checkbox to save.

   ![playbook-filter-autofilter.png](https://3463426153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgaMaDyA7IyU5W44zuyhm%2Fuploads%2Fgit-blob-8cc634dcdf7e8c73721ca836605a61545d7b060b%2F692ecd69d4bb7dbe665842bbaf689178b30910176d6b53b929dd53a9ddd5a084.png?alt=media)
7. Click **Test**.

   ![playbook-filter-autotest.png](https://3463426153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgaMaDyA7IyU5W44zuyhm%2Fuploads%2Fgit-blob-70c19e8300fc38b059e0f3bae950763c659812a6%2F784dae0068ecc92fc5d1e8d636d7bcdd4277f5a01ff732099dd5373337d558cd.png?alt=media)


---

# 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/playbook-design-guide/playbook-design-guide/filters-and-transformers/create-filters-and-transformers-in-a-playbook/create-a-filter-advanced-example.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.
