Using the Tanium 7.2 Advanced Parser: New Syntax Features and Shortcuts in the Question Bar and Question Builder
Starting with Tanium 7.2, we have introduced additional features within the Question Bar and Question Builder. These new features help simplify the process of asking a question, and in some cases can help you avoid having to write a regular expression to do the type of filtering you trying to achieve.
Below are a list of features now available in the Tanium Console:
-
Column Filtering on Sensors with Multiple Columns
-
Nested Filters
-
The ‘in’ operator
-
Question Bar and Question Builder transition improvements
-
Re-order capability in Question Builder
-
Substring Filter
-
Computer Group Filtering
-
Advanced Sensor Settings
This post will outline a few different examples of how these new features and shortcuts can be utilized. Please note that to get all these features, you will need to be on the current GA release of 7.2.314.3476 or 7.3.314.3641. However, because these were introduced over time, some of these features may have been available in previous builds.
Column Filtering on Sensors with Multiple Columns
The Situation: I want to return all Installed Applications where the Version of that Application contains 4.1.3, but I do not want to return Application Names which contain this version. I don’t want to have to use a regular expression (regex) to filter on the column.
The Resolution:
Get Installed Applications having Installed Applications:Version contains 4.1.3 from all machines
The above question now allows you to filter the Installed Applications sensor on just the version column. Previously, this could be done but only using a regex. We have simplified this process by allowing this new syntax. This functionality is also available within the Question Builder:
Nested Filters and the ‘in’ operator
The Situation: I want to return Computer Name and Installed Applications where Adobe Reader Version 9.5.0 or 11.0.6 are installed, without having to use a regular expression.
The Resolution:
Get Computer Name and Installed Applications having Installed Applications:Name contains Adobe Reader from all machines with Installed Applications:Name contains Adobe Reader and Installed Applications:Version in(9.5.0,11.0.06)
Just like in our last example, I’m filtering on a specific column for the sensor, but I’m also using some new shortcut syntax to filter on multiple versions of Adobe Reader. When that parses out, it will be:
Get Computer Name and Installed Applications having Installed Applications:Name contains Adobe Reader from all machines with ( Installed Applications:Name contains Adobe Reader and ( Installed Applications:Version equals 9.5.0 or Installed Applications:Version equals 11.0.06 ) )
Transition to Question Builder and Re-ordering
The Situation: I have a question provided to me by a teammate and I want to make modifications to it. I’m not quite sure what sensor I want to use, so I would like to make the modifications in the Question Builder, but it historically has not always allowed a smooth transition from the Question Bar.
The question is:
Get Computer Name and Installed Applications having Installed Applications:Name contains Adobe Reader from all machines with ( Installed Applications:Name contains Adobe Reader and ( Installed Applications:Version equals 9.5.0 or Installed Applications:Version equals 11.0.06 ) )
The Resolution: Click Copy to Question Builder and the question will be properly displayed in the Question Builder, including the combination of and/or on the filter side of the question. Additionally, as seen in the screenshot below, the order of the sensors can be moved to re-order how the filter is applied or how the results appear in the Results Grid.
Substring Filter and Computer Group Filtering
The Situation: I want to find all machines that are part of the Emeryville Workstations computer group, where the machine name contains SRV starting at the 6th character in the name.
The Resolution:
Get Computer Name having $substring(Computer Name, 5, 3) equals SRV from Emeryville Workstations
The substring function breaks down as follows: $substring(Sensor, Starting Position, Length). So in the example, the substring will look at three letters, starting with the 6th character, in the computer name. Please note: values start at 0 so the value of 5 is the 6th character.
Also note, in the syntax above, instead of writing “from all machines” I wrote “from Emeryville Workstations”. The parser will now parse out the definition of the computer groups. You can also see that the additional features are now available in the Question Builder:
Advanced Sensor Settings
The Situation: I want to change the Tanium client log verbosity level on multiple endpoints, and to know sooner than the 15-minute sensor expiration time if the value changed.
The Resolution:
Get Registry Value Data[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Tanium\Tanium Client,LogVerbosityLevel]?maxAge=60 contains 0 from all machines
While the functionality to change maxAge was possible by going into the Question Builder, you now have the ability to add any of the Advanced Sensor Options directly into the question from the parser.
For additional information about Advanced Question Syntax, please see: Reference: Advanced question syntax (tanium.com)No Content found for /db/organizations/tanium/repositories/master/content/documents/userguides/interact/example_advanced_questions.dita.