Hi,

If I understand correctly what you are trying to do, you can run that
search on the host index page instead of on the facts page, and you will
only get the list of hosts matching the value.
That is also possible by passing the search string as a parameter to the
api/cli (for the host list) for automation.


On Wed, Mar 1, 2017 at 5:05 PM, Chris Baldwin <[email protected]> wrote:

> Hi folks,
>
> I'm trying to figure out the equivalent of:
>
> grep $value facts | print $hostnames | sort -u
>
> That'll get us a list of hosts that all have $facts. We know for a fact
> (no pun intended) that there's a potential for each host to have multiple
> facts with $value (we're scanning for blockdevice models).
>
> What does the Foreman UI give us? If we search for this in the facts pane:
> facts.blockdevice_sda_model = SYMMETRIX or facts.blockdevice_sdb_model =
> SYMMETRIX or (sdc, sdd, etc..)
>
> We get a list that'll have $host1 in there once for every blockdevice that
> matches. In our case, that means well over 100k matches (we have hosts with
> lots of blockdevices :) ). How can I apply a "unique" filter/modifier to
> that so a host appears only once?
>
> Some other considerations:
> * The people running this query do not have access to the Foreman DB
> * The do have access to the CLI/API, so we can always write a script
> that'll iterate through all the pages (hundreds of them).
> * We're running Foreman 1.12
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Have a nice day,
Tomer Brisker
Red Hat Engineering

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to