PuppetDB has a REST API from which you can query facts like this:
curl -Gs "http://localhost:8080/pdb/query/v4/facts/YOUR_FACT"
Replace YOUR_FACT with the actual name of your custom fact (or any other fact).
The output is a JSON document. To get a list mapping the FQDN of the server to the value of the fact you can use jq
like this:
curl -Gs "http://localhost:8080/pdb/query/v4/facts/YOUR_FACT" |
jq -r '.[]|[.certname, .value]|@tsv'
That will produce output like
bar2342.example.org abc
baz13.example.org def
foo.example.org ghi
...
Use column
to get the columns aligned properly:
curl -Gs "http://localhost:8080/pdb/query/v4/facts/YOUR_FACT" |
jq -r '.[]|[.certname, .value]|@tsv' |
column -ts $'\t'
Output:
bar2342.example.org abc
baz13.example.org def
foo.example.org ghi
...