# Filters

### Creating Filters

Creating **filters** is an important step in setting up rules and generating insights for your data. The insights or findings you see are primarily based on how you set up these filters and what data they select. Filters allow you to focus on specific sets of data to generate meaningful insights based on your needs. Let’s walk through how you can create filters using the different fields available to you.

### **Steps to Create Filters**

1. **Navigate to any page on which supports filtering**\
   In this example, we are using the *Connections* page under the Entities section.<br>

   <figure><img src="/files/6bkRLl2qrei5fCxf2NZo" alt=""><figcaption></figcaption></figure>
2. **Open the filters panel**\
   On the top left corner of the page, click the **Filters** button to open the filter slideout.\ <br>

   <figure><img src="/files/3ItSuZe5yzSFf6om6hiJ" alt=""><figcaption></figcaption></figure>
3. **Use different fields to set your filter**\
   In the filter slideout, you can combine different fields to select the data that fits your needs.
4. Select the filter configuration you wish to save.
5. Click the *Save filter* button at the bottom of the Filters menu.<br>

   <figure><img src="/files/TsBxEeUo1O4kFyAhAa0b" alt=""><figcaption></figcaption></figure>
6. Name and click *Save Filter* to save the filter configuration.<br>

   <figure><img src="/files/MMVtrKNGXIN8cON5BfMl" alt=""><figcaption></figcaption></figure>

You can view the list of Saved Filters on your tenant by visiting the *Global Filters* tab in your Global *Settings* page.

### Explanation of filter fields

Most filter fields are intuitive in nature. Here are descriptions for some that might not be straightforward, which is available across the application:

* **Name**: Select the specific **name** of the entity you want to filter. For example, you can filter by the name of a resource/identity/connection/insight.
* **Entity Type**: Choose the **type** of entity you want to filter. You can filter by **identity**, **resource**, **connection**, or **insight**.
* **Source Type**: This field refers to the terminology used in the applications that provide the data (e.g., in GitHub, a "team" is mapped as a **connection entity** and a "repository" is mapped as a **resource entity** in our model. Here the terms "team" and "repository" are referred to as source types).
* **Source System**: This field filters data based on where the entity comes from. It could be an application integration, the system that assigns roles and permissions (RBAC), or the source of insights.
* **App**: Select from the list of **applications** that have been integrated into your tenant. This helps filter entities based on specific apps. There can be multiple integrations of the same application but with different credentials.
* **Integration**: Choose an **application integration** that has been set up in your tenant. This allows you to filter based on the specific integration you want to focus on.
* **User**: Filter entities based on the **user** selected. This is useful if you want to see data tied to a specific user.
* **Manager**: Filter by a **manager**. This helps you select data tied to users managed by the person you select.
* **Department**: Use this filter to select entities tied to a **department** users belongs to. You can filter data based on the department.
* **Job Title**: Filter based on the **job title** of users. For example, you can filter for all data associated with users who have the job title "Engineer."
* **Employment Type**: Filter entities based on the **employment type** (e.g., full-time, part-time) of users.
* **Insights**: This filter shows entities tied to specific **insights** set up in your tenant. You can filter based on the insights you’ve created for analysis.

#### Understanding the "Having" Section (deprecated)

{% hint style="info" %}
Note: This section has been deprecated now. We do not recommend using this filter field.
{% endhint %}

The **Having** section is particularly useful when filtering based on how different entities are connected. An example of when this section can be used:

* To select resources that an identity has access to through a connection, you can simply choose an identity as the entity type and use the having section to specify the connection that you want to see which the identity has access to.

The **Having** field allows you to filter based on these relationships. You can use it to narrow down data based on whether an identity has access to a resource, or if certain insights are tied to the data you're interested in. Those specified above are just a few examples for using the having field. You could get innovative and try selecting data you desire accurately if these fields are used efficiently.

## **Using Saved Filters**

Saved filters can be used anywhere the Filters menu is available.

To apply a saved filter:

1. Open the *Saved Filters* drop down menu and select the Saved Filter you would like to apply.<br>

   <figure><img src="/files/dVWAuNOX7JzINXmM1B1H" alt=""><figcaption></figcaption></figure>
2. Once Saved Filter is applied and loaded, filtered results will be visible on the page.

## **Editing a Saved Filter**

1. Go to *Global Settings* > *Global Filters* tab under the Configure section.
2. Click on the edit icon on the filter you want to edit.
3. The filter page opens up. Make the required changes to your filter and click on the *Save Filter* button.<br>

   <figure><img src="/files/B8dhu2T0pgS8rL9oqSHg" alt=""><figcaption></figcaption></figure>
4. When you save a filter, you’ll see a dialog asking you to name it. You can keep the existing name or change it if you’d like.

   You’ll then have two options:

   1. **Save (overwrite):**\
      This updates the existing filter. The original filter is replaced with your latest changes.
   2. **Save as copy:**\
      This keeps the original filter exactly as it is and saves your changes as a new filter. The new filter will be created as a copy of the original, with an updated name to indicate it’s a copy.

   Choose **Save (overwrite)** if you want to modify the same filter, or **Save as copy** if you want to keep both the original and the edited version.

{% hint style="warning" %}
**Note**: If a filter is currently being used in a custom insight or rule, you won’t be able to edit or overwrite it directly. In this case, the only available option will be **Save as copy**, which creates a new filter with your changes while keeping the original filter unchanged.
{% endhint %}

<figure><img src="/files/zseNJMQqE4aMIXCtutz3" alt="" width="375"><figcaption></figcaption></figure>

## **Deleting a Saved Filter:**

{% hint style="warning" %}
**Note**: If a filter is currently being used in a custom insight or rule, you won’t be able to delete. Ensure that the filter is not being used before attempting to delete a filter.
{% endhint %}

1. Navigate to the *Global filters* tab in the *Global Settings* page.<br>

   <figure><img src="/files/181ifFEiAOWeLhPKMYux" alt=""><figcaption></figcaption></figure>
2. Click on the "*Delete"* icon on whichever filter you would like to delete.
3. A dialog box appears to confirm deletion. Click on "*Delete"* again to delete your Saved filter.

   <figure><img src="/files/Of6GApNPJxPRt5FHdPKH" alt="" width="375"><figcaption></figcaption></figure>

### Putting It All Together

Now that you’re familiar with the available fields, you can create filters by combining them to match your specific use case.

For example:

* **Find users in a department with access to a resource**\
  Set filters like:\
  **Department = Sales** and **Resource = prod-ec2-instance**
* **Report on access by job role**\
  To see how often managers are accessing a particular application, set filters such as:\
  **Job Title = Engineer** and **App = Okta**

By combining fields, you can build filters that give you exactly the insights you’re looking for.


---

# Agent Instructions: 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:

```
GET https://docs.balkan.id/getting-started/entitlement-data-discovery/filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
