puppetdb query return values

3 views
Skip to first unread message

Matt Zagrabelny

unread,
Dec 13, 2019, 5:54:08 PM12/13/19
to puppet...@googlegroups.com
Greetings,

I've looked through the puppetdb docs, in particular the PQL docs, to find out if I can extract a single parameter in the return value(s).

I have as a PQL:

resources[parameters] { type = "Postgresql::Server::Pg_hba_rule" and parameters.address ~ "."}

I'd like to get the "address" parameter. So some pseudocode like:

resources[parameters.address]

I know I can post process the results, but is there a way to get a single parameter in PQL?

Thanks,

-m

Austin Blatt

unread,
Dec 14, 2019, 12:29:30 AM12/14/19
to puppet...@googlegroups.com
Hi Matt,

You should be able to do that now that we've finished PDB-2634, which is available in PuppetDB 6.7.0+.

The { } are still required, so a query could look like

resources[certname, parameters.address] {

  type = "Postgresql::Server::Pg_hba_
rule"
  and parameters.address ~ ".*"
}



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAOLfK3UZuh5jvdFjq5giQbifcM5RU6--oL-KDoLo0SuPMCu2KQ%40mail.gmail.com.


--
Austin Blatt
Software Engineer
Reply all
Reply to author
Forward
0 new messages