Re: [Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2015-08-12 Thread Ken Barber
 Can you help with this query?  I am trying to get 2 facts from all of our
 puppet clients in PuppetDB.
 I tried variations of the following, but no luck: ('[or, [=, name,
 kernelversion], [=, name, instance_uuid]]')

For me this query works. Here is the full curl example in the latest
PDB (I replaced instance_uuid with operatingsystem, since I don't have
that fact and I wanted to show it working with _something_):

# curl -G 'http://localhost:8080/pdb/query/v4/facts' --data-urlencode
'query=[or,[=,name,kernelversion],[=,name,operatingsystem]]'
[ {
  certname : kb.local,
  environment : production,
  name : operatingsystem,
  value : Darwin
}, {
  certname : kb.local,
  environment : production,
  name : kernelversion,
  value : 14.4.0
} ]%

ken.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAE4bNTm3wBtqEvcWnMjy63U7P3T5E4kOcv6%2BHQ8vMPLL41dQqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2015-08-12 Thread robert keating
Can you help with this query?  I am trying to get 2 facts from all of our 
puppet clients in PuppetDB.  
I tried variations of the following, but no luck: ('[or, [=, name, 
kernelversion], [=, name, instance_uuid]]')

Thank you!

On Tuesday, September 3, 2013 at 11:09:19 AM UTC-7, Ken Barber wrote:

 Is it acceptable to do the search based on 'certname'? ie: 

 curl -G 'http://localhost:8080/v2/facts' --data-urlencode 
 'query=[and,[~,certname,puppetdb?],[or,[=,name,ipaddress],[=,name,hostname]]]'
  


 ken. 

 On Mon, Sep 2, 2013 at 7:00 AM, Klavs Klavsen kl...@enableit.dk 
 javascript: wrote: 
  This gives me the ipaddress (and hostname).. now to figure out how to 
 filter 
  on hostname regex.. 
  
  'query=[=, name, ipaddress]' 
  
  -- 
  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 javascript:. 
  To post to this group, send email to puppet...@googlegroups.com 
 javascript:. 
  Visit this group at http://groups.google.com/group/puppet-users. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0a5346a6-2668-42bd-ab1b-334089b17133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2013-09-04 Thread Klavs Klavsen
Den tirsdag den 3. september 2013 20.09.19 UTC+2 skrev Ken Barber:

 Is it acceptable to do the search based on 'certname'? ie: 

 curl -G 'http://localhost:8080/v2/facts' --data-urlencode 
 'query=[and,[~,certname,puppetdb?],[or,[=,name,ipaddress],[=,name,hostname]]]'
  



 Thank you - that worked beautifully :)

Only detail - is that it shows 2 results for each host - one for each 
fact being retrieved.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2013-09-03 Thread Ken Barber
Is it acceptable to do the search based on 'certname'? ie:

curl -G 'http://localhost:8080/v2/facts' --data-urlencode
'query=[and,[~,certname,puppetdb?],[or,[=,name,ipaddress],[=,name,hostname]]]'

ken.

On Mon, Sep 2, 2013 at 7:00 AM, Klavs Klavsen kl...@enableit.dk wrote:
 This gives me the ipaddress (and hostname).. now to figure out how to filter
 on hostname regex..

 'query=[=, name, ipaddress]'

 --
 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+unsubscr...@googlegroups.com.
 To post to this group, send email to puppet-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/puppet-users.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2013-09-02 Thread Klavs Klavsen
I also tried https://github.com/dalen/puppet-puppetdbquery - but that 
didn't really get me any closer :(

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2013-09-02 Thread Klavs Klavsen
This gives me the ipaddress (and hostname).. now to figure out how to 
filter on hostname regex..

'query=[=, name, ipaddress]'

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.