Relevance help required

I am trying to get actions info using below relevance, earlier it used to work but not now with v9.5.11.

(IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , Names of member actions of actions of it) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , "Not Reported" , "Not Reported" , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions

Someone can pls suggest on this.

Can you provide some details on how it no longer works? Do you receive an error of some kind (if so, what is the error)? Is the data returned not what you expect?

(Note that I’ve edited your post above to remove some extra double-quotes and to improve readability/formatting).

Hi,

I am getting nothing when I am running but when I am trying to breaking it piece by piece its working but at a level it stop when I passing “Names of member actions of actions of it”

C:\Program Files (x86)\BigFix Enterprise\BES Server\IEM CLI>iem get query --relevance=“(IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , Names of member actions of actions of it) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , “”“Not Reported””" , “”“Not Reported”“” , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions"

<?xml version="1.0" encoding="UTF-8"?> 44.534ms Plural

C:\Program Files (x86)\BigFix Enterprise\BES Server\IEM CLI>

Any suggestion please.

You might add some defensive coding in here. Tuples will drop any instance where one of the members of the tuple is an error or null.

The pipe character | works as a quick if/then/else and can be used for this use case.
The trick with the pipe is the type of the return has to be the same on both sides, and it does not accept plurals.

<string>|<string>    ok
<integer>|<string>   not ok.
<plural string>|<string>   not ok

You can use Concatenation "x" of to deal with the plural. Putting those together, try substituting this phrase

Names of member actions of actions of it

(concatenation ";" of Names of member actions of actions of it |"<missing>")

3 Likes

Hi,

I tried the same but no success. Below is the screen shot.

Below is sample of actionout.xml from old days when It was perfectly working fine with version 9.5.3

image

Using >> (double) tells the OS to append the results to an existing file. Try > (single) instead.

tried in that way too but same error, I thought may be issue with rights its not allowing in C drive so diverted to temp but same thing.

C:\Program Files (x86)\BigFix Enterprise\BES Server\IEM CLI>iem get query --relevance="((IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , (concatenation ";" Names of member actions of actions of it |"<missing>")) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , """Not Reported""" , """Not Reported""" , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions" > C:\actionout.xml
The system cannot find the file specified.

C:\Program Files (x86)\BigFix Enterprise\BES Server\IEM CLI>iem get query --relevance="((IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , (concatenation ";" Names of member actions of actions of it |"<missing>")) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , """Not Reported""" , """Not Reported""" , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions" > C:\temp\actionout.xml
The system cannot find the file specified.

However if I am keeping old line in place of line which suggested by @brolly33 file is getting created.

C:\Program Files (x86)\BigFix Enterprise\BES Server\IEM CLI>iem get query --relevance="((IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , Names of member actions of actions of it) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , """Not Reported""" , """Not Reported""" , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions" >> C:\actionout.xml

C:\Program Files (x86)\BigFix Enterprise\BES Server\IEM CLI>

<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
	<Query Resource="((IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it , IP Addresses of Computers of it , Last Report Times of Computers of it , Detailed Status of it , Status of it as string , Names of member actions of actions of it) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , &quot;Not Reported&quot; , &quot;Not Reported&quot; , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it) , it) of bes actions">
		<Result></Result>
		<Error>This expression could not be parsed.</Error>
	</Query>
</BESAPI>

It is very difficult for us to make use of your screenshots, as we cannot copy & paste your text into our test machines, and there is likely a syntax error such as a misplaced comma, and it will be difficult for us to test that we have typed exactly as your screenshots show.

Suggest you copy and paste the actual text of your queries into the post, and use the “Preformatted Text” button to display it as code in the forum.

1 Like

oopps :slight_smile: Modified older post !

1 Like

@vk.khurava

The fundamental problem is a conflict with the extra double quotes needed to identify strings in the relevance query. Windows Command Prompt is trying to deal with them before passing everything along to the iem cli program, hence “The system cannot find the file specified”. You also have an extra left parenthesis at the beginning of your relevance. Try the following, using percent encodes (%22 escapes the double quote character):

iem GET query --relevance "(IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it, IP Addresses of Computers of it , Last Report Times of Computers of it, Detailed Status of it , Status of it as string , (concatenation %22;%22 of Names of member actions of actions of it | %22<missing>%22)) of results of bes actions ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , %22Not Reported%22 , %22Not Reported%22 , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it), it) of bes actions" --outFile c:\actionout.xml

2 Likes

Many Thanks to @itsmpro92 @JasonWalker @brolly33 @Aram ! finally I am able to get the desired data :slight_smile:

Is there any possibility in to add filter for expired/stopped/open actions, now when I am fetching data its file size is huge so want to filter out while taking with either expired or stopped or open.

Sure, use a whose-it clause like so:

bes actions whose (state of it is %22Stopped%22)

actions can have 3 states: Expired, Open, or Stopped

iem GET query --relevance "(IDs of Actions of it , Names of Issuers of Actions of it , Names of Actions of it , States of Actions of it , Times Issued of Actions of it , Names of Computers of it , Operating Systems of Computers of it, IP Addresses of Computers of it , Last Report Times of Computers of it, Detailed Status of it , Status of it as string , (concatenation %22;%22 of Names of member actions of actions of it | %22<missing>%22)) of results of bes actions whose (state of it is %22Stopped%22) ; (IDs of item 1 of it , Names of Issuers of item 1 of it , Names of item 1 of it , States of item 1 of it , Times Issued of item 1 of it , Names of item 0 of it , Operating Systems of item 0 of it , IP Addresses of item 0 of it , Last Report Times of item 0 of it , %22Not Reported%22 , %22Not Reported%22 , Names of member actions of item 1 of it) of (elements of (set of targeted computers of it - set of computers of results of it), it) of bes actions whose (state of it is %22Stopped%22)" --outFile c:\actionout.xml

1 Like