<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic search question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70244#M17583</link>
    <description>&lt;P&gt;In the search field, I entered: &lt;CODE&gt;source=/logs/*/*.log&lt;/CODE&gt;  it matches &lt;CODE&gt;/logs/*/*.log&lt;/CODE&gt; and &lt;CODE&gt;/logs/*/*/*.log&lt;/CODE&gt;.  I need to see only the &lt;CODE&gt;/logs/*/*.log&lt;/CODE&gt; entries and not the &lt;CODE&gt;/logs/*/*/*.log&lt;/CODE&gt; entries. What should I change on the "search string" ? Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2011 12:57:19 GMT</pubDate>
    <dc:creator>laughterjj</dc:creator>
    <dc:date>2011-09-05T12:57:19Z</dc:date>
    <item>
      <title>search question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70244#M17583</link>
      <description>&lt;P&gt;In the search field, I entered: &lt;CODE&gt;source=/logs/*/*.log&lt;/CODE&gt;  it matches &lt;CODE&gt;/logs/*/*.log&lt;/CODE&gt; and &lt;CODE&gt;/logs/*/*/*.log&lt;/CODE&gt;.  I need to see only the &lt;CODE&gt;/logs/*/*.log&lt;/CODE&gt; entries and not the &lt;CODE&gt;/logs/*/*/*.log&lt;/CODE&gt; entries. What should I change on the "search string" ? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2011 12:57:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70244#M17583</guid>
      <dc:creator>laughterjj</dc:creator>
      <dc:date>2011-09-05T12:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: search question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70245#M17584</link>
      <description>&lt;P&gt;try:  source="/logs/&lt;EM&gt;/&lt;/EM&gt;.log"  NOT  source="&lt;EM&gt;/logs/&lt;/EM&gt;/&lt;EM&gt;/&lt;/EM&gt;.log" &lt;/P&gt;

&lt;P&gt;eventually with backslashes. But really you should avoid the wildcard in searches for performance reason&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2011 13:46:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70245#M17584</guid>
      <dc:creator>mzorzi</dc:creator>
      <dc:date>2011-09-05T13:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: search question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70246#M17585</link>
      <description>&lt;P&gt;You're seeing &lt;CODE&gt;log/*/*/*.log&lt;/CODE&gt; because Splunk interprets the wildcard "greedily", i.e. it will match as much as possible.&lt;/P&gt;

&lt;P&gt;There is no way that I know of to make the wildcards non-greedy, but there are workarounds that you can use. One is to specify explicitly that you want sources that match &lt;CODE&gt;/logs/*/*.log&lt;/CODE&gt; but not &lt;CODE&gt;/logs/*/*/*.log&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/logs/*/*.log" AND NOT source="/logs/*/*/*.log"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or you could use &lt;CODE&gt;regex&lt;/CODE&gt; to filter results, like below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/logs/*/*.log" | regex source="/logs/[^/]+/[^.]+\.log"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Sep 2011 13:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-question/m-p/70246#M17585</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-05T13:48:26Z</dc:date>
    </item>
  </channel>
</rss>

