I have two relevance. Each work great on there own but I want to merge them and cant seem to get it work.
q: ( (unique values of (it as string) of values whose(it as string as trimmed string != “”) of keys “Software\Tableau\Tableau 10.1\LicenseCache” of keys whose(exists key “Software\Tableau\Tableau 10.1\LicenseCache” of it) of key “HKEY_USERS” of registry) )
A: license is valid
q:( (unique values of (it as string) of values whose(it as string as trimmed string != “”) of keys “Software\Tableau\Tableau 2018.2\LicenseCache” of keys whose(exists key “Software\Tableau\Tableau 2018.2\LicenseCache” of it) of key “HKEY_USERS” of registry) )
A: license is valid
However I do not know how to merge the two to make it a single relevance.
Let’s start with some simple house keeping.
When you post Relevance to the Forum, it REALLY helps if you format it using the “</>” option in the toolbar. After you paste your Relevance into the browser editing field, select it and click the button. It will bookend your text with the proper characters so your Relevance shows up like this …
( (unique values of (it as string) of values whose(it as string as trimmed string != "") of keys "Software\Tableau\Tableau 2018.2\LicenseCache" of keys whose(exists key "Software\Tableau\Tableau 2018.2\LicenseCache" of it) of key "HKEY_USERS" of registry) )
This preserves the Quote characters so we don’t have to tinker with fixing them in order to be able to copy your Relevance into the FixletDebugger tool and evaluate it.
OK, I’ll climb off my soapbox now.
You haven’t really told us how you want to merge the two clauses. Is this a case of “If one is TRUE, then we’re done” or do they BOTH need to be True?
Since you had to tolerate my soapbox rant, I’ll give you both. Caveat here, I obviously don’t have these registry keys on my computer, so I can’t actually TEST these, but because I formatted them properly in the forum, you should be able to simply Copy/Paste them into your FixletDebugger and test them.
Check if Either has the value “license is valid” …
Q: IF ((((unique values of (it as string) of values whose(it as string as trimmed string != "") of keys "Software\Tableau\Tableau 10.1\LicenseCache" of keys whose(exists key "Software\Tableau\Tableau 10.1\LicenseCache" of it) of key "HKEY_USERS" of registry)) = "license is valid") OR (((unique values of (it as string) of values whose(it as string as trimmed string != "") of keys "Software\Tableau\Tableau 2018.2\LicenseCache" of keys whose(exists key "Software\Tableau\Tableau 2018.2\LicenseCache" of it) of key "HKEY_USERS" of registry)) = "license is valid")) THEN ("license is valid") ELSE ("license is NOT valid")
Check if BOTH have the value “license is valid” …
Q: IF ((((unique values of (it as string) of values whose(it as string as trimmed string != "") of keys "Software\Tableau\Tableau 10.1\LicenseCache" of keys whose(exists key "Software\Tableau\Tableau 10.1\LicenseCache" of it) of key "HKEY_USERS" of registry)) = "license is valid") AND (((unique values of (it as string) of values whose(it as string as trimmed string != "") of keys "Software\Tableau\Tableau 2018.2\LicenseCache" of keys whose(exists key "Software\Tableau\Tableau 2018.2\LicenseCache" of it) of key "HKEY_USERS" of registry)) = "license is valid")) THEN ("license is valid") ELSE ("license is NOT valid")
2 Likes
Thank you for dealing with the format of my post
No problem really, let me know if either of them work for you.
Maybe I ask wrong but that is not the answer i was looking for. I just input a answer there just as an example because the value is a multi line value. I just want it to pull the value of that key location if it exist if it has a value in String Value “Desktop”
Also its not really a true or false just a Analysis to Returning Value data of of a registry key value but I want it in a one liner instead of having 2 different roll.
So, do you see what I did with the clauses?
((relevance clause) = "string")
will return a Boolean value (True/False) that you can then check or include in another Boolean comparison.
yes I understand the clause you put there. But the value of that key could be null which mean it has no license key or it could be a mixture of anything. It is not a set value as each license key output a different value.
So you just care that it HAS a value?
value or no value it can be blank i just want to merge the two relevance.
I’m guessing I’m just being a little thick right now, but I don’t understand what you mean?
I am doing an Analysis of a software called Tableau. We have many different version of this software and for every version it has it own key in the registry. Instead of doing 5 different Analysis for each software version to check for the license i just want to merge them into one line. For example Tableau v10.5, Tableau v11, Tableau v 2018.2, Tableau v 2019. Each of them has it own properties lines. I just them all in one Analysis Properties lines. Sorry for the confusion I am not in front of my work pc to look at bigfix to get the exact detail I had to look it up on the internet. Plus Happy 4th of July.
OK, that explanation helps. I actually do something similar when I have the same software packages installed under Windows, Mac, and Linux/UNIX systems, but wont to only have ONE Analysis returning a set of Properties.
I that’s what you are trying to do, then I recommend using a set of nested IF/THEN/ELSE statements. It gets to be rather messy sometimes, and the clauses can get quite long. The hardest thing sometimes is to make sure that ALL of the “THEN” clauses return the same property types (strings/integers/versions/etc).
IF (Exists key1/value1) THEN (Value1 as string of Key1) ELSE (IF (Exists Key2/Value2) THEN (Value2 as string of Key2) ELSE (IF (Exists Key3/Value3) THEN (Value3 as string of Key3) ELSE (NOTHING)))
The object “NOTHING” returns essentially a “no value” or “null” and seems to be compatible with all the other property types.
The above structure is essentially three nested IF/THEN/ELSE statements so it’s going to be “exclusive” in terms of you will only get the Value for the First one that Exists on a given endpoint. If you need to be able to check for multiple instances on a single endpoint, I’ll need to think about that one some more.
Is this a bit closer to the kind of thing you are trying to do?
Bingo that why I was banging my head against the wall.
If you need more help with it later on, let me know.
didnt think about using if i will test and let you know after 4th of july
To build on @TimRice’s query, for a case like that another approach could be to use plurals. To find any valid license key you can take advantage of the fact that an empty result is valid for plurals.
unique values of (it as string) of values whose(it as string as trimmed string != "") of keys "LicenseCache" of keys of keys "Software\Tableau" of keys of key "HKEY_USERS" of registry
1 Like
Thank you so much exactly what i was looking. This community is improving my bigfix skills.