Wyatt,

Thanks for your reply.  I changed out my url and facta to my fact name, 
nothing is returned except this.

[ ]

To ensure it wasn't my fact that was messing this up, I tried another 
standard fact is_pe.  The value should be uppercase "False" but this 
returns a 500 when run that post/GET.

:8080/pdb/query/v4/nodes -d 'query=["and", ["=", ["fact", 
"operatingsystemmajrelease"], 7], ["=", ["fact", "is_pe"], False]]'

This returns nothing as well.  I have about 350 nodes of this type.

:8080/pdb/query/v4/nodes -d 'query=["and", ["=", ["fact", 
"operatingsystemmajrelease"], 7], ["=", ["fact", "is_pe"], false]]'

My fact value is lowercase as well, true is the value.  Any ideas?  

Thanks in advance,
Mike



On Friday, June 3, 2016 at 9:56:41 AM UTC-5, Wyatt Alt wrote:
>
> Hey Mike,
> I'm thinking you want something like this:
>
> curl -X GET http://localhost:8080/pdb/query/v4/nodes -d 'query=["and", 
> ["=", ["fact", "operatingsystemmajrelease"], 7], ["=", ["fact", "facta"], 
> true]]'
>
> Wyatt
>
>
>
> On Fri, Jun 3, 2016 at 6:40 AM, Mike Sharpton <shar...@gmail.com 
> <javascript:>> wrote:
>
>> Hey all,
>>
>> I am trying to do what should be a simple thing.  I need to query 
>> PuppetDB to gather a list of machines based on arbitrary facta being equal 
>> to true and the operatingsystemmajrelease fact being 7.  I have searched 
>> around and found a few examples, but can't get them to work properly.  I 
>> saw and example from Wyatt on here, but I must be doing something wrong as 
>> I can't even get that to run.  I have PuppetDB 3.2.0.
>>
>> I'm not sure if I should be running my query against this endpoint 
>> /pdb/query/v4/facts/, or drill into the facta uri and run a in/and against 
>> the operatingsystemmajrelease fact to get what I need.  All I need back is 
>> the certname of the machines in which facta is true and 
>> operatingsystemmajrelease is 7.  If someone has a quick one liner, it would 
>> be appreciated, otherwise I can bust out the data and filter it with 
>> Excel.  Thanks,
>>
>> Mike
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/5a1fec0e-1d02-442f-9465-9660a6087a8f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/5a1fec0e-1d02-442f-9465-9660a6087a8f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/5560a1c7-b2a9-482c-a1cd-e493b3dad2b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to