Relevance To Pull Registry Values

I am using the following relevance query in a .net core web app, using the API. It works and pulls all of my servers as expected:

    string relevanceQuery = @"
    (
    id of it, 
    name of it, 
    ip addresses of it, 
    last report time of it
    ) of bes computers";

However, when I add the lines to the query to pull reg values as well, i get “No results found”. I’ve verified the reg key/values are all there.

    string relevanceQuery = @"
    (
    id of it, 
    name of it, 
    ip addresses of it, 
    last report time of it,
    (if exists values ""PatchDayOffset"" of keys ""HKEY_LOCAL_MACHINE\SYSTEM\KREM"" of registry then value of it as string else ""-1""),
    (if exists values ""PatchHour"" of keys ""HKEY_LOCAL_MACHINE\SYSTEM\KREM"" of registry then value of it as string else ""-1""),
    (if exists values ""PatchMinute"" of keys ""HKEY_LOCAL_MACHINE\SYSTEM\KREM"" of registry then value of it as string else ""-1""),
    (if exists values ""RebootDayOffset"" of keys ""HKEY_LOCAL_MACHINE\SYSTEM\KREM"" of registry then value of it as string else ""-1""),
    (if exists values ""RebootHour"" of keys ""HKEY_LOCAL_MACHINE\SYSTEM\KREM"" of registry then value of it as string else ""-1""),
    (if exists values ""RebootMinute"" of keys ""HKEY_LOCAL_MACHINE\SYSTEM\KREM"" of registry then value of it as string else ""-1"")
    ) of bes computers";

Registry inspector is Client Relevance not Session Relevance.

That why you don’t get results

In your case, I would create an Analysis and create a Property for each Client Relevance you mentioned.

After that you can use Session Relevance to query data from the Analysis

2 Likes

Could be… I need to grab values from the registry of computers and stick them into variables for my asp.net application to run