Filters

Filters are listed on the left hand side of various windows. They are used to filter the display of these windows, allowing an Administrator to quickly find and focus on only certain items.

Each record in the Programs window potentially represents an aggregate of several individual program versions. A search filter looks for satisfaction based on ANY of the individual versions within the aggregate. This can sometimes lead to confusing results.

For example, compare a [search for all programs that ARE published by Microsoft] with a [search for all programs NOT published by Microsoft]. Chances are that there exist program line items (i.e. program variants listed in the Programs window) that satisfy both searches! All it takes is a variant that includes one program version with Microsoft in the publisher field while a second program version (aggregated into the same variant) has no publisher in the publisher field.

Computer and Program filters can also have associated Rules which are applied when computers or programs are discovered (or when new information about an existing item is discovered). If you add a rule to a filter in these windows, it floats to the top of the filter list.

Filters can also be used to restrict the scope of reports. With a filter selected, right-click to see the drop down menu which includes a list of all the reports that will accept the selected filter as a restriction. For example, a program filter can be used to restrict any report that deals with programs (e.g. a report whose detail lines are programs).

Filters can be applied by clicking just to the left of the filter you wish to apply in the selected window. Doing so will change which items are displayed in the main pane. You can also double-click a filter, which will open up a new window that will display only the filtered items. This window will not have the left-hand section which the main window has. It also has a section at the top where the filter can be edited, and which can either be collapsed or expanded.

Check marks are used in each pane of the Display column (left side of the window) to activate individual Filters, Divisions, Folders, etc. A combination of check marks will select all items that match at least one check marked condition in every pane that is used for the selection (e.g. has at least one check mark). This means that when a pane is being used for selection (so it has at least one check mark), an additional check mark will generally increase the number of items displayed as a match. If an additional pane is activated for the selection (by adding a check mark to a pane that had none), then the number of items displayed as a match will generally decrease.

To make a Filter, right click in the Filters section of the left pane of any Window and choose New Filter.

Filter Details



There are three ways of specifying a filter:

  • Match This String is a generic option to find a string that exists in any common field of the object type. That is, you could type in "bill" and in the Computers window this would find any computers who's name contained bill, had a last user that contained bill, was in a division named billing, etc. It is the quickest and easiest way to find things, but it is very broad.
  • Match These Values has a multiple selection list of items appropriate for the window in which you're creating the filter. This is an easy pick and choose interface where you don't need to worry about writing a custom query. The more options you choose, the more granular the search results will be (these are "and" matches).
  • Match This Filter allows you to write complex custom filters that the UI does not allow for, including filtering on custom fields in the computer window. See below for more on this type.
  • If you click the Apply button at the top, the filter will be saved with the name you gave it, and the results will be shown in the pane at the bottom of the window.

    For Computers or Programs, there is a Rule sub pane in the upper right. Once you verify the filter works using Apply, you can check off actions to turn the filter into a Rule. In the future, any computer that connects will be processed by the Rule, for example to sort into a Division according to Name.

    Group membership can be specified as a selector when creating a Computer filter in the graphical interface - but the behavior may be surprising! Computers which are members of the group due to a Node, Location, or Division clause in the Group definition will be selected as expected. But a computer that is a member of the group due only to external authentication will not be included among the selected computers when using the filter! This is because authentication generally bases group membership on user name, rather than computer, and it is not terribly meaningful to check the “Last User” for group membership. Also, if a group is specified in a filter, but the group contains only filters, the filter by group will not include computers that match the filter defined in the group - since this extra level of indirection is not necessary.

    Custom Filters

    The Match This Filter option allows for custom selection criteria specified using less common fields which are not included in the graphical interface. Also, it allows you to specify multiple values for the same field, or use boolean logic beyond simply the "AND" operator.

    If you start out by choosing various conditions in the Match These Values section, and then change to Match This Filter, you will see a text representation of the filter you have specified. The basic format is a series of conditions in parentheses, separated by " && ". Each condition involves one field name and one constant. Here is a list of rules for writing filters.

    Here are some complex examples:

    Specific Items

    There are a number of special criteria that are stored in various flag values in the database. These are not specifically documented, but can be useful in many common cases. Here are some useful filter strings that may be of interest:

    Sample Filters – Import & Export

    The standard ksp-admin installation includes an xml file, placed in "Sassafras K2/Admin/Misc/", that defines several sample filters. You may find these useful either directly or as a basis for your own further customization. To import only relevant sample filters for use in just one of KeyConfigure's list windows, simply drag the xml file, "Sample Filters.xml", and drop it onto the filters area of the window. Alternatively, the entire set of sample filters can be imported all at once by dragging the "Sample Filters.xml" file and dropping it onto the KeyConfigure program file itself. To save an xml copy the current filters defined for a particular list window, use the Export context menu item under the Filter section label. [Note: these xml files are readable as text, so you may find "Sample Filters.xml" useful to look at even without importing.]