Filter your nodes by PQL query

Filter your nodes list using a common PQL query.

Filtering your nodes list by PQL query enables you to manage them by specific factors, such as by operating system, report status, or class.

  • Specify a target by doing one of the following:
    • Enter a query that selects the target you want. See the Puppet Query Language (PQL) reference for more information.
    • Click Common queries, select one of the queries, and replace the defaults in the braces ({ }) with values that specify the target you want.

      TargetPQL query
      All nodesnodes[certname] { }
      Nodes with a specific resource (example: httpd)resources[certname] { type = "Service" and title = "httpd" }
      Nodes with a specific fact and value (example: OS name is CentOS)inventory[certname] { facts.os.name = "<OS>" }
      Nodes with a specific report status (example: last run failed)reports[certname] { latest_report_status = "failed" }
      Nodes with a specific class (example: Apache)resources[certname] { type = "Class" and title = "Apache" }
      Nodes assigned to a specific environment (example: production)nodes[certname] { catalog_environment = "production" }
      Nodes with a specific version of a resource type (example: OpenSSL v1.1.0e)resources[certname] {type = "Package" and title="openssl" and parameters.ensure = "1.0.1e-51.el7_2.7" }
      Nodes with a specific resource and operating system (example: httpd and CentOS)inventory[certname] { facts.operatingsystem = "CentOS" and resources { type = "Service" and title = "httpd" } }