Knife search edge cases


#1

I’m routinely frustrated by knife search queries. Is there a more
detailed guide that what’s on docs.opscode.com or does anyone have any
general tips from past experience?

Hopefully without diminishing the general query above and then only
getting explicit replies to these questions… how do I escape a ':'
that I want to match against in my query? how do I escape a ’ '?


#2

On Fri, Jun 6, 2014 at 6:44 PM, Jeff Blaine jblaine@kickflop.net wrote:

I’m routinely frustrated by knife search queries. Is there a more
detailed guide that what’s on docs.opscode.com or does anyone have any
general tips from past experience?

Which docs are you looking at? I’d say
http://docs.opscode.com/essentials_search.html is pretty detailed, and a
vast improvement on the search docs I recall from the old wiki. That said,
nothing’s perfect and I’m sure the Chef folks would appreciate feedback on
what’s missing.

Hopefully without diminishing the general query above and then only

getting explicit replies to these questions… how do I escape a ':'
that I want to match against in my query? how do I escape a ’ '?

Any “special” character can be escaped with a backslash, and colon is
included in that set (see
http://docs.opscode.com/essentials_search.html#special-characters ). You
don’t need to escape spaces.

Most of the things that I thought were under-documented in the past (eg,
nested field syntax, gotchas searching for run list items) seem to be
thoroughly covered in the current docs, so I’m coming up short on other
hints and tips. If you were expanding the docs, are there any particular
headlines or topics you’d like to see filled out?

Zac


#3

This probably helps too:

https://github.com/opscode/chef-docs/commit/ae51ad2e2fe62b4fc63d685e1a5a3725b88d3a91

Gets more information about the query patterns into the actual
knife_search.html page.

On Fri, Jun 6, 2014 at 11:02 AM, Zac Stevens zts@cryptocracy.com wrote:

On Fri, Jun 6, 2014 at 6:44 PM, Jeff Blaine jblaine@kickflop.net wrote:

I’m routinely frustrated by knife search queries. Is there a more
detailed guide that what’s on docs.opscode.com or does anyone have any
general tips from past experience?

Which docs are you looking at? I’d say
http://docs.opscode.com/essentials_search.html is pretty detailed, and a
vast improvement on the search docs I recall from the old wiki. That said,
nothing’s perfect and I’m sure the Chef folks would appreciate feedback on
what’s missing.

Hopefully without diminishing the general query above and then only

getting explicit replies to these questions… how do I escape a ':'
that I want to match against in my query? how do I escape a ’ '?

Any “special” character can be escaped with a backslash, and colon is
included in that set (see
http://docs.opscode.com/essentials_search.html#special-characters ). You
don’t need to escape spaces.

Most of the things that I thought were under-documented in the past (eg,
nested field syntax, gotchas searching for run list items) seem to be
thoroughly covered in the current docs, so I’m coming up short on other
hints and tips. If you were expanding the docs, are there any particular
headlines or topics you’d like to see filled out?

Zac


#4

On 6/6/2014 4:10 PM, James Scott wrote:

This probably helps too:

https://github.com/opscode/chef-docs/commit/ae51ad2e2fe62b4fc63d685e1a5a3725b88d3a91

Gets more information about the query patterns into the actual
knife_search.html page.

Yes. That! I wasn’t hitting that with google. Thanks James and Zac.

Digging back through my bash history from earlier today, here’s a
problem case:

% knife search ‘lastrun_runtimes_end:2014-06-06 11:33*’ -i | grep eleven
eleven
% knife node show eleven -a lastrun.runtimes.end
eleven:
lastrun.runtimes.end: 2014-06-06 16:01:05 -0400

o_O
Jeff

On Fri, Jun 6, 2014 at 11:02 AM, Zac Stevens <zts@cryptocracy.com
mailto:zts@cryptocracy.com> wrote:

On Fri, Jun 6, 2014 at 6:44 PM, Jeff Blaine <jblaine@kickflop.net
<mailto:jblaine@kickflop.net>> wrote:

    I'm routinely frustrated by knife search queries. Is there a more
    detailed guide that what's on docs.opscode.com
    <http://docs.opscode.com> or does anyone have any
    general tips from past experience?


Which docs are you looking at?  I'd say
http://docs.opscode.com/essentials_search.html is pretty detailed,
and a vast improvement on the search docs I recall from the old
wiki.  That said, nothing's perfect and I'm sure the Chef folks
would appreciate feedback on what's missing.

    Hopefully without diminishing the general query above and then only
    getting explicit replies to these questions... how do I escape a ':'
    that I want to match against in my query? how do I escape a ' '?


Any "special" character can be escaped with a backslash, and colon
is included in that set (see
http://docs.opscode.com/essentials_search.html#special-characters ).
 You don't need to escape spaces.

Most of the things that I thought were under-documented in the past
(eg, nested field syntax, gotchas searching for run list items) seem
to be thoroughly covered in the current docs, so I'm coming up short
on other hints and tips.  If you were expanding the docs, are there
any particular headlines or topics you'd like to see filled out?


Zac