BigFix CLI Issue

OK, a little new to this so here goes:

I have session relevance here that works:

(item 0 of it as string & “$x$” & item 1 of it as string & “$x$” & item 2 of it as string & “$x$” & item 3 of it as string & “$x$” & item 4 of it as string & “$x$” & item 5 of it as string) of ((if (exists Names of Sites of it | false) then (concatenations “%0A” of (Names of Sites of it as string)) else ("")) , (if (exists ID of it | false) then (concatenations “%0A” of (ID of it as string)) else ("")) , (if (exists Name of it | false) then (concatenations “%0A” of (Name of it as string)) else ("")) , (if (exists Source ID of it | false) then (concatenations “%0A” of (Source ID of it as string)) else ("")) , (if (exists Applicable Computer Count of it | false) then (concatenations “%0A” of (Applicable Computer Count of it as string)) else ("")) , number of results whose (exists last became relevant of it AND exists last became nonrelevant of it AND last became relevant of it < last became nonrelevant of it) of it) of bes fixlets whose (((Type of it as string as lowercase = “fixlet”) AND (Source ID of it as string as lowercase contains “cce”) AND (Custom Flag of it = False)))

It works fine from session relevance tester however, when i try to use the iem cli wrapper, I get this:

C:\Users\jmckinzie.ROOTSG\Desktop\IEM CLI>iem.exe GET query --relevance=(item 0 of it as string & “$x$” & item 1 of it as string & “$x$” & item 2 of it as string & “$x$” & item 3 of it as string & “$x$” & item 4 of it as string & “$x$” & item 5 of it as string) of ((if (exists Names of Sites of it | false) then (concatenations “%0A” of (Names of Sites of it as string)) else ("")) , (if (exists ID of it | false) then (concatenations “%0A” of (ID of it as string)) else ("")) , (if (exists Name of it | false) then (concatenations “%0A” of (Name of it as string)) else ("")) , (if (exists Source ID of it | false) then (concatenations “%0A” of (Source ID of it as string)) else ("")) , (if (exists Applicable Computer Count of it | false) then (concatenations “%0A” of (Applicable Computer Count of it as string)) else ("")) , number of results whose (exists last became relevant of it AND exists last became nonrelevant of it AND last became relevant of it < last became nonrelevant of it) of it) of bes fixlets whose (((Type of it as string as lowercase = “fixlet”) AND (Source ID of it as string as lowercase contains “cce”) AND (Custom Flag of it = False)))

Parameters must be of the form ‘–key value’ or ‘–key=value’
’"$x$"’ is not recognized as an internal or external command,
operable program or batch file.
‘item’ is not recognized as an internal or external command,
operable program or batch file.
’"$x$"’ is not recognized as an internal or external command,
operable program or batch file.
‘item’ is not recognized as an internal or external command,
operable program or batch file.
’"$x$"’ is not recognized as an internal or external command,
operable program or batch file.
‘item’ is not recognized as an internal or external command,
operable program or batch file.
’"$x$"’ is not recognized as an internal or external command,
operable program or batch file.
‘item’ is not recognized as an internal or external command,
operable program or batch file.
’"$x$"’ is not recognized as an internal or external command,
operable program or batch file.
‘item’ is not recognized as an internal or external command,
operable program or batch file.

Any Ideas?

Your OS is seeing your relevance and is thinking it is commands for itself. Try wrapping your --relevance= in “”. Note, this will require replacing all single-" in your relevance with double-"" marks (command processor will convert it back when passing it to iem.exe.

OK So now I have this:

iem.exe GET query --relevance="(item 0 of it as string & “”$x$"" & item 1 of it as string & “”$x$"" & item 2 of it as string & “”$x$"" & item 3 of it as string & “”$x$"" & item 4 of it as string & “”$x$"" & item 5 of it as string) of ((if (exists Names of Sites of it | false) then (concatenations “”%0A"" of (Names of Sites of it as string)) else ("""")) , (if (exists ID of it | false) then (concatenations “”%0A"" of (ID of it as string)) else ("""")) , (if (exists Name of it | false) then (concatenations “”%0A"" of (Name of it as string)) else ("""")) , (if (exists Source ID of it | false) then (concatenations “”%0A"" of (Source ID of it as string)) else ("""")) , (if (exists Applicable Computer Count of it | false) then (concatenations “”%0A"" of (Applicable Computer Count of it as string)) else ("""")) , number of results whose (exists last became relevant of it AND exists last became nonrelevant of it AND last became relevant of it < last became nonrelevant of it) of it) of bes fixlets whose (((Type of it as string as lowercase = ““fixlet””) AND (Source ID of it as string as lowercase contains ““cce””) AND (Custom Flag of it = False)))"

Is that what you were saying?

It still doesn’t seem to work.

I work only with Linux version of iem, but maybe it will work on Windows too. Try to url-encode the string. In your case the command would look like
iem.exe GET query --relevance=%28item%200%20of%20it%20as%20string%20%26%20%22%24x%24%22%20%26%20item%201%20of%20it%20as%20string%20%26%20%22%24x%24%22%20%26%20item%202%20of%20it%20as%20string%20%26%20%22%24x%24%22%20%26%20item%203%20of%20it%20as%20string%20%26%20%22%24x%24%22%20%26%20item%204%20of%20it%20as%20string%20%26%20%22%24x%24%22%20%26%20item%205%20of%20it%20as%20string%29%20of%20%28%28if%20%28exists%20Names%20of%20Sites%20of%20it%20%7C%20false%29%20then%20%28concatenations%20%22%250A%22%20of%20%28Names%20of%20Sites%20of%20it%20as%20string%29%29%20else%20%28%22%22%29%29%20%2C%20%28if%20%28exists%20ID%20of%20it%20%7C%20false%29%20then%20%28concatenations%20%22%250A%22%20of%20%28ID%20of%20it%20as%20string%29%29%20else%20%28%22%22%29%29%20%2C%20%28if%20%28exists%20Name%20of%20it%20%7C%20false%29%20then%20%28concatenations%20%22%250A%22%20of%20%28Name%20of%20it%20as%20string%29%29%20else%20%28%22%22%29%29%20%2C%20%28if%20%28exists%20Source%20ID%20of%20it%20%7C%20false%29%20then%20%28concatenations%20%22%250A%22%20of%20%28Source%20ID%20of%20it%20as%20string%29%29%20else%20%28%22%22%29%29%20%2C%20%28if%20%28exists%20Applicable%20Computer%20Count%20of%20it%20%7C%20false%29%20then%20%28concatenations%20%22%250A%22%20of%20%28Applicable%20Computer%20Count%20of%20it%20as%20string%29%29%20else%20%28%22%22%29%29%20%2C%20number%20of%20results%20whose%20%28exists%20last%20became%20relevant%20of%20it%20AND%20exists%20last%20became%20nonrelevant%20of%20it%20AND%20last%20became%20relevant%20of%20it%20%3C%20last%20became%20nonrelevant%20of%20it%29%20of%20it%29%20of%20bes%20fixlets%20whose%20%28%28%28Type%20of%20it%20as%20string%20as%20lowercase%20%3D%20%22fixlet%22%29%20AND%20%28Source%20ID%20of%20it%20as%20string%20as%20lowercase%20contains%20%22cce%22%29%20AND%20%28Custom%20Flag%20of%20it%20%3D%20False%29%29%29

How did you get all that? Is there a url encode script I run to convert relevance to the new url encode format or do you simply use the hex code for the quotes?

Nevermind, I see how you do it.

Thank you so much!

I used the fastest way… online tool :slight_smile:
https://www.urlencoder.org/