Filter Wildcards
I work for a school district and I am having problems creating filters that accurately reflect our deployment requirements. I hit a wall when I find the need for more than the four criteria. Before I rename 450 PCs I was hoping to find a better solution.
Our PCs are named SITE-ROOM-PC. The teacher's PC in each room ends in a -1. Some teacher's PCs are named -1A, -1B, -1C because of replaced equipment.
My first filter attempt
(Name begins with SITE-
AND Name contains -1)
gave me a list which included SITE-LAB-11, SITE-11-2, etc. which are not teacher PCs.
All other attempts run into a limitation on how many conditions I can use.
If I could use a wild card I would be all set
System Name begins with SITE-
AND System Name ends with -1*
Can you use wild cards of some sort? If I could test for a Label within a Filter that would work too.
David
Our PCs are named SITE-ROOM-PC. The teacher's PC in each room ends in a -1. Some teacher's PCs are named -1A, -1B, -1C because of replaced equipment.
My first filter attempt
(Name begins with SITE-
AND Name contains -1)
gave me a list which included SITE-LAB-11, SITE-11-2, etc. which are not teacher PCs.
All other attempts run into a limitation on how many conditions I can use.
If I could use a wild card I would be all set
System Name begins with SITE-
AND System Name ends with -1*
Can you use wild cards of some sort? If I could test for a Label within a Filter that would work too.
David
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
simonds
14 years ago
Posted by:
airwolf
14 years ago
If you go to the Filter tab under Reporting, you can create a SQL filter from scratch or modify an existing filter with as many different criteria as you like. It's not as easy as using the four filter fields, but you've got the power (if you are comfortable modifying SQL). Your only other option is to use REGEX to create filter expressions to pattern match instead of using wildcards. The wildcard character for SQL, by the way, is the percentage symbol (%). For example, "begins with SITE-%-1" would match everything that begins with SITE- and ends with -1. However, the filter also automatically throws a % at the end of the "begins with" match, so it would really be "SITE-%-1%". Use a REGEX if you want a very precise filter.
Posted by:
simonds
14 years ago
Posted by:
afzal
14 years ago
Posted by:
GillySpy
14 years ago
You can use SQL wildcards in the UI fields.
here's a list I found. I frequently use the first two. Haven't tried the others -- usually use regex at that point.
here's a list I found. I frequently use the first two. Haven't tried the others -- usually use regex at that point.
Wildcard Description
% A substitute for zero or more characters
_ A substitute for exactly one character
[charlist] Any single character in charlist
[^charlist] Any single character not in charlist
or
[!charlist]
Posted by:
sdickenson
14 years ago
David, we name our PC's somewhat similarly (BuildingRoom-Asset) and make heavy use of regex filters on the PC's name for creating dynamic labels. We then deploy software to these labels. This allows us to ensure that certain software (i.e., Kidpix) is always on certain machines (i.e., lower school classrooms) regardless of the asset tag (for when computers are replaced or moved). It's all based on the location information in the name.
A sample regex that we use looks like this:
^(MN(10[8,9]|111|20[0,1,4])|MA2|FH1)
This looks a little daunting at first, but is really quite easy to grasp once you read up on regular expression syntax a bit. That one criteria covers all of our lower school classrooms in three different buildings.
A quick Google of "regex intro" and "regex cheatsheet" turns up more than few great resources. Spend 30 minutes learning them - it's worth your time for more than just the KBOX. I've used them for years in everything from Perl scripts to mail server configurations.
A sample regex that we use looks like this:
^(MN(10[8,9]|111|20[0,1,4])|MA2|FH1)
This looks a little daunting at first, but is really quite easy to grasp once you read up on regular expression syntax a bit. That one criteria covers all of our lower school classrooms in three different buildings.
A quick Google of "regex intro" and "regex cheatsheet" turns up more than few great resources. Spend 30 minutes learning them - it's worth your time for more than just the KBOX. I've used them for years in everything from Perl scripts to mail server configurations.
Posted by:
lindsamw
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.