PQL has_history() function
has_history() — Returns a boolean result that indicates
whether or not a node contains history information.
Syntax
The has_history() function
returns a boolean expression, and takes one parameter:
boolean /#has_history(tree input)
Return value
The has_history() function produces a boolean result.
Description
The has_history() function produces
a boolean result to the yes-or-no question of whether or not a node contains history
information. The has_history() function can take any number of parameters.
Examples
You can try the following examples against your own data in the GoToManage search field, or against fictitious data in the Query Sandbox:
- Example 1: History of in_octets
- Example 2: History of installed software
- Example 3: History of systems with low disk space
Example 1: History of in_octets
Query: Do the in_octet nodes have history data?
SELECT /#has_history FROM /network/device/interface/in_octets
Results: Depending on the database, this query returns results similar to this:
row has_history() false row has_history() false row has_history() true row has_history() true row has_history() false . . .
Example 2: History of installed software
Query: Which software has been installed since January 1st, and does it contain history?
SELECT name, /#has_history FROM /network/device/wmi/win32_product WHERE installdate > '20080101'
Results: Depending on the database, this query returns results similar to this:
row name Adobe Acrobat 8 Professional has_history() true row name Skype\x99 3.6 has_history() false row name Windows Defender has_history() true . . .
Example 3: History of systems with low disk space
Query: Do the systems with low disk space have history information?
SELECT /#has_history(systemname) FROM %free disk space% WHERE freespace < 1000000000 AND description = 'Local Fixed Disk'
Results: Depending on the database, this query returns results similar to this:
row has_history(systemname) true row has_history(systemname) false row has_history(systemname) false
To see other PQL functions, see Functions.