<?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 Re: Which of these searches is the best way to filter (by index, by source, or both)? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347311#M102840</link>
    <description>&lt;P&gt;In this case, having the extra data is certainly not going to hurt, but really, you ALWAYS want to specify the index, because then splunk does not have to look ANYWHERE ELSE.   Giving it the source as well as that helps it narrow further.&lt;/P&gt;

&lt;P&gt;Splunk  would have figured out - almost certainly, after a glance at the summary stats  - that there were none of that source  anywhere else, by checking all the other indexes.  But why make it go to even that meager effort?&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2017 01:53:00 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-03-14T01:53:00Z</dc:date>
    <item>
      <title>Which of these searches is the best way to filter (by index, by source, or both)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347308#M102837</link>
      <description>&lt;P&gt;Which of these would be the most efficient/fast/best way to start filtering for a search?  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/bar/baz.log" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo source="/var/log/bar/baz.log" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We're going to have an index that will have several &lt;CODE&gt;**/*.log&lt;/CODE&gt; sources, each with similar but unique data formats.  We'll always know the data source and index for these queries.  I'm wondering the best way start my queries.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 21:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347308#M102837</guid>
      <dc:creator>driekhof</dc:creator>
      <dc:date>2017-03-13T21:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Which of these searches is the best way to filter (by index, by source, or both)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347309#M102838</link>
      <description>&lt;PRE&gt;index=foo source="/var/log/bar/baz.log" | ...&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/Search/Writebettersearches"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.2/Search/Writebettersearches&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;From the documentation&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Restrict your search to the specific host, index, source, source type, or Splunk server whenever possible. Read more about using fields in your searches in the next section.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 23:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347309#M102838</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2017-03-13T23:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Which of these searches is the best way to filter (by index, by source, or both)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347310#M102839</link>
      <description>&lt;P&gt;That still isn't clear to me whether specifying both helps any over just specifying the most specific which would be source in my case.  I was thinking Splunk might already know that this source is only in this index and optimize it, or already index the sources.  I guess I'd have to profile using just the source vs the index and the source to  be sure.  But thanks for the info.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 00:17:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347310#M102839</guid>
      <dc:creator>driekhof</dc:creator>
      <dc:date>2017-03-14T00:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Which of these searches is the best way to filter (by index, by source, or both)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347311#M102840</link>
      <description>&lt;P&gt;In this case, having the extra data is certainly not going to hurt, but really, you ALWAYS want to specify the index, because then splunk does not have to look ANYWHERE ELSE.   Giving it the source as well as that helps it narrow further.&lt;/P&gt;

&lt;P&gt;Splunk  would have figured out - almost certainly, after a glance at the summary stats  - that there were none of that source  anywhere else, by checking all the other indexes.  But why make it go to even that meager effort?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 01:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347311#M102840</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-14T01:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Which of these searches is the best way to filter (by index, by source, or both)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347312#M102841</link>
      <description>&lt;P&gt;Ok, makes sense.  I was just being paranoid about writing the shortest, clearest most concise query possible.  And wanted to make sure specifying both source and index wouldn't cause Splunk to do extra work.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 15:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347312#M102841</guid>
      <dc:creator>driekhof</dc:creator>
      <dc:date>2017-03-14T15:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Which of these searches is the best way to filter (by index, by source, or both)?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347313#M102842</link>
      <description>&lt;P&gt;Good goal.  In this case quite the reverse, I think.  If you can limit the search to a single index, or a limited set of them, then you'll (in theory) save splunk a slight bit of time in the search parsing.  Overall run time is unlikely to be affected much, again, in my somewhat limited experience.  &lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 19:39:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Which-of-these-searches-is-the-best-way-to-filter-by-index-by/m-p/347313#M102842</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-14T19:39:30Z</dc:date>
    </item>
  </channel>
</rss>

