Hoof Hearted
2012-Dec-28 06:26 UTC
[Puppet Users] example curl-based puppetdb query equivalent to select node.name, node.role from nodes where dept = ''finance''
The examples in the puppetdb docs show how I can query for a list of node names. What if I want more fields? Could someone share an example of how you query puppetdb to return multiple values? Like what if you want the node''s name and what the custom fact "role" says, for all nodes that have the custom fact "dept" = "finance"? In other words as an example SQL: select node.name, node.role from nodes where dept = ''finance'' it''s documented what you need to do for the WHERE part, but not really (or I overlooked it possibly) for the columns you want to select. Am I missing something? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/u2y-XQBMD78J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hoof Hearted
2013-Jan-01 16:38 UTC
[Puppet Users] how do you do the equivalent of this SQL statement in puppetdb?
I need to be more succinct. How do you do the following with puppetdb? select count(*), date(created_at) from hosts group by 2 order by 2 desc; Is puppetdb only setup so it will return back the host? Will I need several GETs to filter out a subset of data, and then process it? On Thursday, December 27, 2012 10:26:33 PM UTC-8, Hoof Hearted wrote:> > The examples in the puppetdb docs show how I can query for a list of node > names. What if I want more fields? Could someone share an example of how > you query puppetdb to return multiple values? Like what if you want the > node''s name and what the custom fact "role" says, for all nodes that have > the custom fact "dept" = "finance"? > > In other words as an example SQL: > select node.name, node.role from nodes where dept = ''finance'' > > it''s documented what you need to do for the WHERE part, but not really (or > I overlooked it possibly) for the columns you want to select. Am I missing > something? > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/og1DWzE3lqwJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hoof Hearted
2013-Jan-19 04:21 UTC
[Puppet Users] Re: how do you do the equivalent of this SQL statement in puppetdb?
To sort of answer my own question (since it''s cached in groups.google.com) .. I know currently believe there is no way to do the same exact thing as in normal mysql-based storeconfigs. But that''s fine with me, I can still just graph it over time as a custom graph in cacti. Thus I declare puppetdb is still awesome and always was. Peace out. On Tuesday, January 1, 2013 8:38:58 AM UTC-8, Hoof Hearted wrote:> > I need to be more succinct. How do you do the following with puppetdb? > > select count(*), date(created_at) from hosts group by 2 order by 2 desc; > > Is puppetdb only setup so it will return back the host? Will I need > several GETs to filter out a subset of data, and then process it? > > > On Thursday, December 27, 2012 10:26:33 PM UTC-8, Hoof Hearted wrote: >> >> The examples in the puppetdb docs show how I can query for a list of node >> names. What if I want more fields? Could someone share an example of how >> you query puppetdb to return multiple values? Like what if you want the >> node''s name and what the custom fact "role" says, for all nodes that have >> the custom fact "dept" = "finance"? >> >> In other words as an example SQL: >> select node.name, node.role from nodes where dept = ''finance'' >> >> it''s documented what you need to do for the WHERE part, but not really >> (or I overlooked it possibly) for the columns you want to select. Am I >> missing something? >> >> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/1IT45Fndq6gJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
kdo
2013-Mar-18 01:50 UTC
[Puppet Users] Re: how do you do the equivalent of this SQL statement in puppetdb?
Hey Hoof, did you ever get to the bottom of how to query and print certain facts about your puppet clients from the command line ? On Saturday, January 19, 2013 2:21:30 PM UTC+10, Hoof Hearted wrote:> > To sort of answer my own question (since it''s cached in groups.google.com) > .. I know currently believe there is no way to do the same exact thing as > in normal mysql-based storeconfigs. But that''s fine with me, I can still > just graph it over time as a custom graph in cacti. > > Thus I declare puppetdb is still awesome and always was. Peace out. > > On Tuesday, January 1, 2013 8:38:58 AM UTC-8, Hoof Hearted wrote: >> >> I need to be more succinct. How do you do the following with puppetdb? >> >> select count(*), date(created_at) from hosts group by 2 order by 2 desc; >> >> Is puppetdb only setup so it will return back the host? Will I need >> several GETs to filter out a subset of data, and then process it? >> >> >> On Thursday, December 27, 2012 10:26:33 PM UTC-8, Hoof Hearted wrote: >>> >>> The examples in the puppetdb docs show how I can query for a list of >>> node names. What if I want more fields? Could someone share an example of >>> how you query puppetdb to return multiple values? Like what if you want the >>> node''s name and what the custom fact "role" says, for all nodes that have >>> the custom fact "dept" = "finance"? >>> >>> In other words as an example SQL: >>> select node.name, node.role from nodes where dept = ''finance'' >>> >>> it''s documented what you need to do for the WHERE part, but not really >>> (or I overlooked it possibly) for the columns you want to select. Am I >>> missing something? >>> >>> >>>-- 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+unsubscribe@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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.