CFXQL - CFX Query Language

What is CFXQL CFX Query Language or CFXQL is a Query language that is flexible enough for both human and programmatic approaches, that can be used to query different data sources. CFXQL allows users to query the data in the cfxDimensions platform in an effective, efficient way.

CFXQL Overview (architecture)

Structure of CFXQL

Each CFXQL query can be one or more logical conditions followed by GET command, followed by column names.
CONDITIONS GET col1, col2 as ‘LABEL1’. The example usage is
1
Equipment_Type is 'CHASSIS'orEquipment_Type is 'CHASSIS' and first_seen is after 'Sep 15 2020, 10am'or (Equipment_Type is 'CHASSIS') and (first_seen is after 'Sep 15 2020, 10am')
Copied!
CFXQL structure (Command/Results)

Example Queries for AIA

Following list captures simple and complex queries that users can run in cfxAIA environment.
  • Simple Queries
    • sw_type = ‘IOS’
    • sw_type == ‘IOS’
    • sw_type eq ‘IOS’
    • sw_type is "IOS"
    • sw_type equals ‘IOS’
    • sw_type is equal to ‘IOS’
    • sw_type in [ ‘IOS’, ‘UCS’ ]
    • sw_type is in ‘IOS’, ‘UCS’
    • sw_type contains ‘OS’
    • sw_type ~ ‘OS’
    • sw_type does contain ‘OS’
    • sw_type !~ ‘OS’
    • sw_type does not contain ‘OS’
    • Sw_type not-contains ‘OS’
    • Sw_type starts with ‘UC’
    • sw_type ^~ ‘UC’
    • sw_type starts-with ‘UC’
    • sw_type starts with other_column_name
    • product_family is empty
    • product_family is blank
    • product_family is null
    • product_family is not empty
    • product_family null
    • product_family not null
  • Complex queries
    • sw_type is equal to ‘NX-OS’ and product_family contains"7000" or Sw_type is equal to ‘NX-OS’ and product_family contains"9000" and os_version contains ‘9.’ and serial_number is not blank
    • (sw_type is equal to ‘NX-OS’ and product_family contains"7000") or (Sw_type is equal to ‘NX-OS’ and product_family contains"9000" and os_version contains ‘9.’)
    • (sw_type is equal to ‘NX-OS’ and product_family contains"7000") or ((Sw_type is equal to ‘NX-OS)’ and (product_family contains"9000" and os_version contains ‘9.’))
    • sw_type == ‘NX-OS’ & product_family ~"7000" | sw_type = ‘NX-OS’ & product_family ~"9000" & os_version ~ ‘9.’
In addition to the above queries, the following queries provide examples from cfxAIA using asset-db:assetLCMMaster dataset.
1
Parent_SN is Serial_Number and first_seen is not null and first_seen is after 'Sep 15 2020, 10am' \get IP_Address, Hostname, Product_ID, Site_Code, CAFM_Code, first_seen, last_seen, \Serial_Number, Device_Role​
Copied!
1
Equipment_Type is 'CHASSIS' and first_seen is not null and first_seen is after 'Sep 18 2020, 10am' \get IP_Address, Hostname, Product_ID, Site_Code, CAFM_Code, first_seen, last_seen, \Serial_Number, Device_Role​
Copied!
1
Equipment_Type is 'CHASSIS' and last_seen is not null and last_seen is before 'Sep 15 2020, 10am' \get IP_Address, Hostname, Product_ID, Site_Code, CAFM_Code, first_seen, last_seen, \Serial_Number, Device_Role​
Copied!

Possible CFXQL Operations

The following table shows all possible operations supported via CFXQL.
Table shows possible operations supported via CFXQL
Table shows possible operations supported via CFXQL
Table shows possible operations supported via CFXQL
The actual Query example is captured in the following code snippet.
1
sw_type is equal to 'NX-OS' and product_family contains '7000' or sw_type is equal to 'NX-OS' and product_family contains '9000' and sw_version contains '9.'
Copied!
Example usage while creating an incident
Example - 1 : Planning to upgrade a device in phase-2 of the Q2 plan. cfxql:
1
sw_type is equal to 'NX-OS' and product_family contains '7000' or sw_type is equal to 'NX-OS' and product_family contains '9000' and sw_version contains '9.' and contract_end_date is before this year
2
Copied!
1
sw_type is equal to 'NX-OS' and product_family contains '7000' and site_code is in 'S1', 'S2' and device_por is equal to 'N-1'
Copied!
Example -2 :
Example usage while creating a Stack cfxql:
1
users ou is "Department1" and role is not "manager" and status is "Active"
Copied!
1
site == 'site1' and family == 'nexus5k' and app_code is in 'App1', 'App2'
Copied!
Last modified 3mo ago
Copy link
Contents