Substitution failed

(imported topic written by Don65)

I’ve altered the following action script number of times, however, it continues to fail. Would very much appreciate it if someone could point out what I might be doing wrong.

Command failed (Relevance substitution failed) regset “” “MTU”=dword:00000514 (fixlet 496093)

When running the above command in Fixlet Debugger, I receive the following error.

Relevance clauses must be surrounded by { and } guards.

(imported comment written by BenKus)

Try escaping the close bracket instead of the open bracket since you are in the middle of the relevance expression…

regset “” “MTU”=dword:00000514

http://support.bigfix.com/cgi-bin/kbdirect.pl?id=1230

Ben

(imported comment written by Don65)

Hi Ben,

Thanks for pointing out the adjustments needed when using a set of brackets within brackets. This little tidbit of information will be very helpful in the future.

On a not so good note, the updated command failed.

Command failed (Relevance substitution failed) regset “” “MTU”=dword:00000514 (fixlet 496160)

I’m wondering if the relevancy within the action script, which returns {EFB6E252-EE2A-4FF1-AAEF-7DC5E2F59FB6}, might be causing an issue given that another set of brackets is unexpectedly being introduced into the substitution.

For example.

Q: value “NetCfgInstanceId” of keys whose (value “ProviderName” of it is “Cisco Systems”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002bE10318}” of registry

A: {EFB6E252-EE2A-4FF1-AAEF-7DC5E2F59FB6}

So in essence the action script might be interpreted as something similiar to

regset “” “MTU”=dword:00000514

(imported comment written by NoahSalzman)

Here is how you debug “Relevance substitution failed”:

That error means the Action Script got an error when trying to “paste in” the Relevance between the { }. So, I dropped this Relevance into the

Fixlet Debugger

:

“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” & (value “NetCfgInstanceId” of keys whose (value “ProviderName” of it is “Cisco Systems”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002bE10318}}” of registry)

It gave an error that indicated that the & could not deal with the string on the left in conjunction with the registry key on the right. The ampersand needs strings on both sides… so, easy, just make the registry key a string:

“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” & (value “NetCfgInstanceId” of keys whose (value “ProviderName” of it is “Cisco Systems”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002bE10318}}” of registry as string)

See if that works.

(I should have removed the extra closing } when I pasted it in the debugger… sort of moot for me, though, since I don’t have that key in my registry.)

(imported comment written by Don65)

That worked. Much appreciated. Yes, highly recommend the use of Fixlet Debugger - wondering why Bigfix still offers the stand alone version of QNA?

I had been using “as string” sort of as a best practice when developing relevancy. Not sure why I didn’t use it this time.

q: “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” & (value “NetCfgInstanceId” of keys whose (value “ProviderName” of it is “Cisco Systems”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002bE10318}” of registry)

E: The operator “concatenate” is not defined.

q: “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces” & (value “NetCfgInstanceId” of keys whose (value “ProviderName” of it is “Cisco Systems”) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002bE10318}” of registry as string)

A: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces{EFB6E252-EE2A-4FF1-AAEF-7DC5E2F59FB6}