Session Relevance for result of analysis

Hi Everyone,

I am trying to write the session relevance to get the result from the analysis as output. I have tried the below session relevance and i am getting the results also.

values of results of properties of BES Analysis whose ( name of it = “free space in linux”)

But for some of the analysis i am getting some garbage values.

Apart from the above problem, I want to get the data in the tabular form with header of the result, just like we get the result of analysis in the “results” tab.

How do I write session relevance for that?

This is sample relevance i have used to get data via rest api + python.

relevance_resolv=’( (names of it, operating systems of it,(if (exists ip address of it) then (concatenation “|” of (ip addresses of it as string)) else ("")),values of results from (BES Property “DNS Current Config”) of it, concatenation “!” of (values of results from (BES Property “TC - Gateway IP” ) of it as trimmed string) ) of members of bes computer groups whose ( name of it = “Unix Servers All”) )’

Thankyou, for the input @bigfixforum

But i want somewhat different result.
Lets suppose I have a analysis named “AIX OS Level” having below properties

  • AIX OS Level
    Technology Date
    Service Pack
    Build Date

I want the output of my session relevance as

Technology Level Service Pack Build Date
03 05-1524 1524
02 03-1524 1524

That’s how the result from the analysis should look like.

For this scenario, you can use a semicolon to create plurals: https://developer.bigfix.com/relevance/guide/basics/singular-and-plural.html

For instance, here’s a simple example that starts with some data:

Q: ("1","2","3","4")
A: 1, 2, 3, 4
T: 0.126 ms
I: singular ( string, string, string, string )

Then adds a ‘header’ row:

Q: ("h1","h2","h3","h4");("1","2","3","4")
A: h1, h2, h3, h4
A: 1, 2, 3, 4
T: 0.079 ms
I: plural ( string, string, string, string )

Given the above, and leveraging an efficient form of relevance to pull multiple property values based on @brolly33’s awesome blog post, here’s a sample bit of relevance that should achieve the desired output:

("Computer Name","AIX Full OS Level","Technology Level","ServicePack","Build Date");
(
name of item 0 of it | "missing name"
, (concatenation ";" of values of results (item 0 of it, elements of item 1 of it))
, (concatenation ";" of values of results (item 0 of it, elements of item 2 of it))
, (concatenation ";" of values of results (item 0 of it, elements of item 3 of it))
, (concatenation ";" of values of results (item 0 of it, elements of item 4 of it))
) of (
elements of item 0 of it
,item 1 of it
,item 2 of it
,item 3 of it
,item 4 of it
) whose (exists values of results (item 0 of it, elements of item 1 of it)) of (
set of BES computers
, set of  bes properties whose (name of source analysis of it = "AIX OS Level" AND name of it as lowercase = ("AIX Full OS Level") as lowercase)
, set of  bes properties whose (name of source analysis of it = "AIX OS Level" AND name of it as lowercase = ("Technology Level") as lowercase)
, set of  bes properties whose (name of source analysis of it = "AIX OS Level" AND name of it as lowercase = ("Service Pack") as lowercase)
, set of  bes properties whose (name of source analysis of it = "AIX OS Level" AND name of it as lowercase = ("Build Date") as lowercase)
)
3 Likes

Oh Thank You @Aram

Is it possible to not provide static values of the header of result of analysis like “Computer Name” , “Technology Name” , rather the code take the names dynamically?