Fun Thoughts on Relevance

I was reading some BigFix code today, like “type of it of it whose it as string of whose of…” and I thought, "Man… I feel like Max Headroom’s therapist!

A colleague said it felt like Dr Seuss was involved with the creation of the relevance language. So we came up with…

“I would not take action in a box, I will not take action with a fox!”
“Would you like it cast as string? would you like it whose it is integer?”
“Not with an integer, not with a string… Leave me alone, I HATE THIS THING”

Just some good fun. Back to the QnA Tool!!

1 Like

For me, it helps to think of it not as a script, but as a SQL query where the tables just happen to be “anything on the computer”.

When you get into deep enough SQL statements with CAST and VARCHAR() and left/inner/outer joins…it’s not exactly the same, but I think in the same family.

1 Like

:slight_smile: I enjoyed this.

I certainly have my own perspective on relevance (I’m a big fan!), but one thing I found helpful early on is the following that describes the 4 major forms of relevance:

  1. <property> of <object>

    • Q: size of file "foo"
    • Basic form of relevance
  2. if (condition) then (something) else (something else)

    • Q: if (exists file "foo") then (size of file "foo") else (0)
    • Good for analysis or retrieved properties
  3. <property> whose (condition of it) of <object>

    • Q: size whose (it > 1000) of file "foo"
    • whose allows filtering
  4. (it) of <property> of <object>

    • Q: (it) of size of file "foo"
    • Allows for singular treatment of items in a list, or to put it another way, a method to iterate over a list

Here’s an old slide in case it comes in handy for anyone:

5 Likes

Tracing all these pronouns (it) is probably the biggest slog of the whole thing.
Hard to believe that after 23 years (including a decade with IBM) the closest to an IDE that we have is highlighting. Not even collapsible nested statements. And the debugger is separate from where you write the code.
Really hoping HCL can move this tech past 2010 standards.

Bizarro-superman

I always thought it was invented by a really smart version of Bizarro

Me am Bizarro whose (it better than Superman)

:smile:

4 Likes

In the fixlet debugger there are other tabs that can expand out the expressions so you can see exactly where they fail for example. This is a tree view of the relevance expression that you entered. It has limitations but can be helpful to figure out where there is a problem in a relevance expression.

2 Likes

@AlanM Great observation. I forget we have a graphical view. Very strong for tracing our pronoun (it)

@Oryx a Hiaku for you, although I too am partial to Seuss.

It is difficult
Sometimes forward sometimes back
Try graphical view

4 Likes

So THAT’S what this tab is for!
Would that it were in the Console, but hey it’s a tool.

I too find it helpful to write in SQL-ish structures. If nothing else, the grammar structure helps my brain.

Relevance can require a certain kind of brain inversion that reminds me of AppleScript, and not in a flattering way. (When I heard Lee Wei mention that the relevance language had been partially inspired by AppleScript, I nearly fell off my chair.)

3 Likes

I had never heard this bit of trivia on relevance. Thanks for sharing it.

There is another technique that I use, especially for large session relevance. The Single Clause View in relevance debugger allows you to multi-line and indent your relevance.

You can also use /* in-line comments*/ in your relevance to help future comprehension.

3 Likes

if you put it in the fixlet debugger, then click on “it” it will highlight what “it” refers to.

I try to keep my relevance flow from right to left as much as possible. Keeps me sane.

I agree, it should be better. I do have this on my list of things I hope to work on, but rarely have time for: Make developing BigFix content, relevance, actionscript easier in VSCode and similar tools · Issue #5 · jgstew/bigfix-content · GitHub

That is pretty great. CC: @bd100001

2 Likes

So is THAT what “single clause” does! Hadn’t had time to figure out what it did that was so special. Nice!!

As far as being “like SQL,” that’s… I dunno, I’ve met some SysAdmins who are DBAs, but they’re far from the majority… and the number of DBAs who are SysAdmins or coders I can count on one hand with room to spare. (Hell, only 1 could find their DB server’s IP address.)

So yeah, no wonder it’s confusing: It comes from a completely different paradigm. SQL and BF both read like someone wanted to make a language that is as “natural” as possible, but capability took over as a goal after the language syntax crystallized so now they’re a strange creole of human and machine tongue.

BigFix is an SCP? :smiley:

2 Likes

I don’t think I was able to make it to this presentation, but I had also heard this about AppleScript / BigFix Relevance.