Skip to content

Commit

Permalink
Add more PQL query examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Nov 19, 2024
1 parent d6c40e8 commit 49c161b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _docs/pql_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,27 @@ Result:

```

### Get value for fact A that have a specific value on fact b

This returns the ip address for all nodes where the trusted fact `pp_role` is `foobar`

```shell
puppet query 'inventory[certname,facts.networking.ip]{ trusted.extensions.pp_role = "foobar"}'
```

```json
[
{
"certname": "bastel.local",
"facts.networking.ip": "127.0.0.1"
},
{
"certname": "freak.local",
"facts.networking.ip": "127.0.0.2"
}
]
```

### Get all values for a structured fact

The facts endpoint doesn't support structured facts :(
Expand Down

0 comments on commit 49c161b

Please sign in to comment.