Session Relevance Tester vs REST API

Hi Guys

I have a question. When using the Session Relevance Tester, I get the correct result for my query.

When using the REST API url, it doesn’t work:

The relevance:

unique values of (it as string) of (((time (item 0 of it) - time "1 Jan 1970 00:00:00 -0000") * 1000 / (1 * second)) as string & ", " & item 1 of it & ", " & (item 2 of it as string) & ", " & ((if (item 3 of it as string = "6") then "Moved Fail" else if (item 3 of it as string = "7") then "Deleted Fail" else if (item 3 of it as string = "8") then "Renamed Fail" else if (item 3 of it as string = "14") then "Cleaned Fail (move fail)" else if (item 3 of it as string = "15") then "Cleaned Fail (delete fail)" else if (item 3 of it as string = "16") then "Cleaned Fail (rename fail)" else if (item 3 of it as string = "25") then "Passed (OKed) a potential security risk" else "Unknown")) & ", " & (item 5 of it as string)) of (tuple string items 0 of item 1 of it, name of computer of item 0 of it, tuple string items 1 of item 1 of it, tuple string items 2 of item 1 of it , tuple string items 3 of item 1 of it, tuple string items 5 of item 1 of it ) whose (item 3 of it as string = "6" or item 3 of it as string = "7" or item 3 of it as string = "8" or item 3 of it as string = "14" or item 3 of it as string = "15" or item 3 of it as string = "16" or item 3 of it as string = "25") of (it, values of it) of (results (applicable
computers of item 0 of it, item 1 of it)) whose (not error flag of it) of (it , property 1 of it) of fixlet 21 of bes site whose (name of it = "Trend Core Protection Module")

This relevance is based on the Web Report “Core Protection Module - Action Fail Report”

Is this normal that it works in the Session Relevance Tester, but not in the REST API url?

Thanks!

FYI:

I’ve reduced the relevance to this:

(values whose (tuple string item 2 of it = "15") of it , name of computer of it) of results of properties of fixlet 21 of bes site whose (name of it = "Trend Core Protection Module")

This works.

Hi

Does anybody have an idea? What does the error mean?
If I try the above relevance with REST API url, I always have that error?

Thanks.

Solved it:

The “/” in the query are giving errors.

Hi,

The relevance in the query parameter should be URL encoded. The browser does some for you, like replacing spaces with %20, but there are certain characters like / (%2F) or & (%26) that have special meanings in URLs so they’d need to be replaced manually.

You can find online url encoding tools like http://meyerweb.com/eric/tools/dencoder/, where you can paste your relevance to get the encoded version you can use in your url. For instance for your relevance expression it would be:

unique%20values%20of%20(it%20as%20string)%20of%20(((time%20(item%200%20of%20it)%20-%20time%20%221%20Jan%201970%2000%3A00%3A00%20-0000%22)%20*%201000%20%2F%20(1%20*%20second))%20as%20string%20%26%20%22%2C%20%22%20%26%20item%201%20of%20it%20%26%20%22%2C%20%22%20%26%20(item%202%20of%20it%20as%20string)%20%26%20%22%2C%20%22%20%26%20((if%20(item%203%20of%20it%20as%20string%20%3D%20%226%22)%20then%20%22Moved%20Fail%22%20else%20if%20(item%203%20of%20it%20as%20string%20%3D%20%227%22)%20then%20%22Deleted%20Fail%22%20else%20if%20(item%203%20of%20it%20as%20string%20%3D%20%228%22)%20then%20%22Renamed%20Fail%22%20else%20if%20(item%203%20of%20it%20as%20string%20%3D%20%2214%22)%20then%20%22Cleaned%20Fail%20(move%20fail)%22%20else%20if%20(item%203%20of%20it%20as%20string%20%3D%20%2215%22)%20then%20%22Cleaned%20Fail%20(delete%20fail)%22%20else%20if%20(item%203%20of%20it%20as%20string%20%3D%20%2216%22)%20then%20%22Cleaned%20Fail%20(rename%20fail)%22%20else%20if%20(item%203%20of%20it%20as%20string%20%3D%20%2225%22)%20then%20%22Passed%20(OKed)%20a%20potential%20security%20risk%22%20else%20%22Unknown%22))%20%26%20%22%2C%20%22%20%26%20(item%205%20of%20it%20as%20string))%20of%20(tuple%20string%20items%200%20of%20item%201%20of%20it%2C%20name%20of%20computer%20of%20item%200%20of%20it%2C%20tuple%20string%20items%201%20of%20item%201%20of%20it%2C%20tuple%20string%20items%202%20of%20item%201%20of%20it%20%2C%20tuple%20string%20items%203%20of%20item%201%20of%20it%2C%20tuple%20string%20items%205%20of%20item%201%20of%20it%20)%20whose%20(item%203%20of%20it%20as%20string%20%3D%20%226%22%20or%20item%203%20of%20it%20as%20string%20%3D%20%227%22%20or%20item%203%20of%20it%20as%20string%20%3D%20%228%22%20or%20item%203%20of%20it%20as%20string%20%3D%20%2214%22%20or%20item%203%20of%20it%20as%20string%20%3D%20%2215%22%20or%20item%203%20of%20it%20as%20string%20%3D%20%2216%22%20or%20item%203%20of%20it%20as%20string%20%3D%20%2225%22)%20of%20(it%2C%20values%20of%20it)%20of%20(results%20(applicable%20%0Acomputers%20of%20item%200%20of%20it%2C%20item%201%20of%20it))%20whose%20(not%20error%20flag%20of%20it)%20of%20(it%20%2C%20property%201%20of%20it)%20of%20fixlet%2021%20of%20bes%20site%20whose%20(name%20of%20it%20%3D%20%22Trend%20Core%20Protection%20Module%22)

1 Like