Filter sets: Organize your hosts

With New Relic infrastructure monitoring, you can combine filters into a filter set to organize hosts based on criteria that matter the most to you.

Read on to learn about the benefits, use, and logic of filter sets.

Benefits of filter sets

You can create filter sets based on any infrastructure attributes or labels.

For example, you can organize your infrastructure into categories such as:

  • Regions
  • Operating system versions
  • Hosts associated with Docker containers
  • Test environments (using custom attributes)

You can share filter sets with other people in your account, and you can quickly identify infrastructure problems by checking the color-coded health status of each host in the filter set.

Create filter sets

The default infrastructure filter set is All hosts, and it serves as a template for you to create filter sets.

To create a filter set:

  1. Go to one.newrelic.com > Infrastructure > (click Hosts, Inventory, or Events).
  2. If All hosts is not displayed in the left sidebar, open that filter set by selecting Saved filter sets > All hosts.
  3. In All hosts, click Filter hosts.
  4. In the list of Attributes and Labels, click an attribute or label to open the list of values.
  5. Click Include or Exclude (see Filter set logic).
  6. Click values individually or enter text to match multiple values.
  7. Continue adding filters until you have the filter set you want.
  8. To name your filter, click the [pencil edit icon] icon, type a name, and click Save.

Edit filter sets

To change an existing filter set:

  1. Go to one.newrelic.com > Infrastructure > (click Hosts, Inventory, or Events).
  2. In the sidebar, click Saved filter sets to open a list.
  3. Locate the filter set by scrolling or by entering a search term.
  4. Click the filter set to open it.
  5. In the sidebar, click an option to update your filter set, and then save.

Delete filter sets

You can delete any saved filter set except the default All hosts.

  1. Go to one.newrelic.com > Infrastructure > Settings > Filter sets.
  2. Click [delete icon] to delete the filter set.

Combine filter sets with grouping

On some pages you can use Group by to group chart results by specific attributes. For example, on the Hosts page, you can group by awsRegion to display the AWS regions with the highest CPU usage.

Grouping applies to the selected filter sets. By combining filter sets with grouping, you can find detailed system information quickly. For an example of using these tools to troubleshoot a problem, see Combining filter sets and grouping.

Copy filters from filter set to alerts

When you create an alert condition, you can build filters individually, or you can copy all the filters from a filter set into a new alert condition. This is a quick shortcut to populate a new alert condition with some filters.

When you copy filter set filters to a new alert condition, these filters are no longer tied to the filter set. If you make changes to the filter set, the alert filters are not affected.

To copy filter set filters to a new alert condition:

  1. Go to one.newrelic.com > Infrastructure > (click Hosts, Inventory, or Events).
  2. In the sidebar, click Saved filter sets to open a list.
  3. Locate the filter set by scrolling or by entering a search term.
  4. Click the filter set to open it.
  5. Mouse over any chart and click ellipsis-h > Create alert.
  6. Enter an alert condition name.
  7. Make adjustments to filters as necessary.
  8. Complete the remaining alert fields (see Create alert conditions).

Filter set logic

When you create a filter set, you generate a list of attribute or label values to narrow the results. This section explains how filter sets apply various rules to the list.

As part of building a filter set, you designate whether a filter should include or exclude entities that match certain values.

The way the inclusion or exclusion works depends on how you select values:

Recommended: Select values by matching a string

You can generate a list of attribute/label values by entering a string that you want values to match. This is useful for matching multiple values.

String matching efficiently generates a list of values, and this approach scales as you add new entities.

Here is the logic filter sets use with string matching:

Comparator Logic
Include

If you click Include and then enter a string that you want values to match, the filter uses the comparator LIKE, which means the results include any entities that are like the string.

For example, you could filter by the term East-, and all entities that contain that term are returned.

Exclude

If you click Exclude and then enter a string that you want values to match, the filter uses the comparator NOT LIKE, which means the results exclude any entities that are like the string.

For example, you could filter by the term West-, and all entities that do not contain that term are returned.

Select values individually

You can click through the list of attributes/labels to identify individual values.

This approach does not scale well if you add new entities.

Here is the logic filter sets use with individual value selection:

Comparator Logic
Include

If you click Include and then click specific values under attributes/labels, the filter uses the comparator IN, which means the filter looks for entities that exactly match one or more values in your list of selections.

Exclude

If you click Exclude and then click specific values under attributes/labels, the filter set uses the comparator NOT IN, which means the filter returns all entities that do not exactly match one or more values in your list of selections.

Filter sets use the logical operators AND and OR behind the scenes to join the data.

Here are the rules for AND and OR:

  • When you click values from multiple attributes or labels, the attributes or labels are joined by AND.
  • When you click values from within an attribute or label, the values are joined by OR.

The filter results display hosts for which both of the following are true:

  • Hosts containing any one of the selected infrastructure agent versions
  • Hosts in any one of the selected AWS availability zones

For more help

If you need more help, check out these support and learning resources: