FAQ
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.

Search Discussions

  • Hoof Hearted at Jan 1, 2013 at 4:39 pm
    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 at Jan 19, 2013 at 4:21 am
    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 at Mar 18, 2013 at 1:50 am
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedDec 28, '12 at 6:34a
activeMar 18, '13 at 1:50a
posts4
users2
websitepuppetlabs.com

2 users in discussion

Hoof Hearted: 3 posts Kdo: 1 post

People

Translate

site design / logo © 2022 Grokbase