Chapter 2. Searching and Bookmarking
2.1. Building Search Queries
2.1.1. Query Syntax
parameter operator value
Table 2.1. Comparison Operators Accepted by Search
|=||EQUALS||Accepts numerical, temporal, or text values. For text, exact case sensitive matches are returned.|| |
|~||LIKE||Accepts text or temporal values. Returns case insensitive matches. Accepts the following wildcards: _ for a single character, % or * for any number of characters including zero. If no wildcard is specified, the string is treated as if surrounded by wildcards: %rhel7%|| |
|>||GREATER THAN||Accepts numerical or temporal values. For temporal values, the operator > is interpreted as "later than", and < as "earlier than". Both operators can be combined with EQUALS: >= <=|| |
The search will return hosts that have been registered after the given date, that is, between 10th January 2017 and now.
The search will return hosts that have been registered yesterday or earlier.
|^||IN||Compares an expression against a list of values, as in SQL. Returns matches that contain or not contain the values, respectively.|| |
|HAS||Returns values that are present or not present, respectively.|| |
On the Puppet Classes page, the search will return classes that are assigned to at least one host group.
On the Dashboard with an overview of hosts, the search will return all hosts that have no assigned host group.
Table 2.2. Logical Operators Accepted by Search
- Text Values
- Text containing whitespaces must be enclosed in quotes. A whitespace is otherwise interpreted as the AND operator.Examples:
hostgroup = "Web servers"The search will return hosts with assigned host group named "Web servers".
hostgroup = Web serversThe search will return hosts in the host group Web with any field matching %servers%.
- Temporal Values
- Many date and time formats are accepted, including the following:
- "10 January 2017"
- "10 Jan 2017"
- "January 10, 2017"
- Today, Yesterday, and the like.
WarningAvoid ambiguous date formats, such as 02/10/2017 or 10-02-2017.