Check out the
headlines
headlines
PQL recognizes the OR operator in the same
way SQL does, to add restrictions in the WHERE
clause.
Here is a query that finds data from any device with an interface with one of the specified names:
SELECT * FROM /network/device WHERE interface/(name = 'eth0' OR name = 'eth1')
The OR operator expands the query to include data
from devices that have an interface either named 'eth0'
or 'eth1'.
If run against the sample database, this query returns the following results:
row
*
system
name 5627
computed_vendor LANIER
computed_model 5627
computed_class printer
computed_score 115
os
version LANIER 5627 5.20
interface
name eth0
mac_address 01:01:02:03:04:05
in_octets 1995335536
out_octets 248342455
oper_status 1
row
*
system
name ESMITH
computed_vendor Intel
computed_class server
computed_score 10
os
version Linux
interface
name eth0
mac_address 02:A1:A2:A3:A4:A4
in_octets 1229592351
out_octets 1472928781
oper_status 1
interface
name eth1
mac_address 03:A1:A2:A3:A4:A5
in_octets 0
out_octets 0
oper_status 0
row
*
system
name AJONES
computed_vendor Intel
computed_class server
computed_score 10
os
version Linux
interface
name eth0
mac_address 04:A1:A2:A3:A4:A8
in_octets 1223098455
out_octets 1523093749
oper_status 1
interface
name eth1
mac_address 05:A1:A2:A3:A4:A9
in_octets 0
out_octets 0
oper_status 0
row
*
system
computed_model Ethernet Switch
computed_class switch
computed_score 25
os
version Ethernet Switch
interface
name eth0
mac_address 06:13:72:F3:0A:F5
in_octets 0
out_octets 0
oper_status 2
interface
name eth1
mac_address 07:13:72:F3:0A:F6
in_octets 0
out_octets 0
oper_status 2
row
*
system
name KRYPTON
computed_model Windows Workstation
computed_class workstation
computed_score 125
os
version Darwin Kernel Version 9.2.2
interface
name eth0
mac_address 08:16:CB:FF:FE:66
in_octets 0
out_octets 346
oper_status 1
interface
name eth1
mac_address 09:16:CB:FF:FE:67
in_octets 0
out_octets 0
oper_status 2
interface
name eth2
mac_address 10:16:CB:FF:FE:68
in_octets 0
out_octets 0
oper_status 2
interface
name eth3
mac_address 11:16:CB:FF:FE:69
in_octets 1598233842
out_octets 2360815490
oper_status 1
row
*
system
name NISSINGETTY
computed_vendor Juniper Networks
computed_model Netscreen Router
computed_class router
computed_score 60
os
version NetScreen-5GT 5.1.043a
interface
name eth0
mac_address 12:10:D8:99:2B:C2
in_octets 1385354750
out_octets 1451321493
oper_status 1
interface
name eth1
mac_address 13:10:D8:99:2B:C1
in_octets 3312952833
out_octets 3239791359
oper_status 1
This query finds disk drive capacity and freespace from all drives of either or both of the specified systems:
SELECT systemname||' '||name, size, freespace FROM /network/device/wmi/win32_logicaldisk WHERE systemname = 'XALAPA' OR systemname = 'HERMOSILLOS'
Here are the results of this query when run against a database that contains both these two systems:
row systemname || || name XALAPA C: size 12889010176 Bytes freespace 3144167424 Bytes row systemname || || name XALAPA D: size 237044310016 Bytes freespace 105538928640 Bytes row systemname || || name HERMOSILLOS C: size 163921571840 Bytes freespace 106091302912 Bytes ...