<?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: How to filter data quickly in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178161#M51241</link>
    <description>&lt;P&gt;You should be able to filter event from each index (for specific IDs) as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A [|inputlookup YourIDLookup.csv | table fieldA | format]| MySearch1 .... 
| join type=outer fieldA [ search index=B [|inputlookup YourIDLookup.csv | table fieldA | format] | MySearch2 .... ] 
| join type=outer fieldA [ search index=A [|inputlookup YourIDLookup.csv | table fieldA | format]| MySearch3 .... ] 
| join type=outer fieldA [ search index=C [|inputlookup YourIDLookup.csv | table fieldA | format]| indexMySearch4 .... ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This way each dataset to be joined will already be filtered for your specific IDs. However, there could a better solution (by avoiding joins) if you could provide the details about operations you're doing in each subsearch.&lt;/P&gt;</description>
    <pubDate>Tue, 27 May 2014 14:42:13 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-05-27T14:42:13Z</dc:date>
    <item>
      <title>How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178155#M51235</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I would like to get advice for search command.&lt;/P&gt;

&lt;P&gt;I have a search that looks like below.&lt;/P&gt;

&lt;P&gt;index=A | MySearch1 ....&lt;BR /&gt;
| join type=outer fieldA [ search index=B | MySearch2 .... ]&lt;BR /&gt;
| join type=outer fieldA [ search index=A | MySearch3 .... ]&lt;BR /&gt;
| join type=outer fieldA [ search index=C | indexMySearch4 .... ]&lt;/P&gt;

&lt;P&gt;I also have a list of fields which I want to search for. The list includes about 20,000 values &lt;BR /&gt;
Fields&lt;BR /&gt;
A&lt;BR /&gt;
B&lt;BR /&gt;
C&lt;BR /&gt;
D&lt;BR /&gt;
E&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;I want to use this list as a input and filter the result with just above values.&lt;BR /&gt;
I understand that my choices are 1.Use Map, 2.Use inner join ,3. Use subsearch&lt;/P&gt;

&lt;P&gt;But none of seems to work out...&lt;/P&gt;

&lt;P&gt;I appreciate if someone can share experience of how to filter with thousands of values.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Yu&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2014 11:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178155#M51235</guid>
      <dc:creator>yuwtennis</dc:creator>
      <dc:date>2014-05-26T11:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178156#M51236</link>
      <description>&lt;P&gt;Hi Yu we could use a little specific information. The fields you want to use in the join sub searches can be filters as per your desired value. If all of them are having common fields then you can do a search like&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=a OR index=b ...|stats (fuction) by A&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2014 12:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178156#M51236</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-26T12:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178157#M51237</link>
      <description>&lt;P&gt;Hi yuwtennis,&lt;/P&gt;

&lt;P&gt;you should use &lt;CODE&gt;join&lt;/CODE&gt; as last resort since there some down sides to this command. Mostly you can use &lt;CODE&gt;stats&lt;/CODE&gt;, &lt;CODE&gt;eventstats&lt;/CODE&gt; or &lt;CODE&gt;streamstats&lt;/CODE&gt;. Since you're joining all sub searches on field &lt;CODE&gt;fieldA&lt;/CODE&gt; I assume this field is available in all events and therefore you can use a search like @linu1988 wrote:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B OR index=C | stats count by fieldA 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B OR index=C | streamstats values(fieldA) AS fieldA | ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2014 16:00:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178157#M51237</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-26T16:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178158#M51238</link>
      <description>&lt;P&gt;Hi linu1988.&lt;/P&gt;

&lt;P&gt;Thank you for the reply.&lt;/P&gt;

&lt;P&gt;The point of my question was not summarize with certain field but filter using certain values in the fields.&lt;/P&gt;

&lt;P&gt;So, for example, I have a lookup table like,&lt;/P&gt;

&lt;P&gt;ID&lt;BR /&gt;
1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
4&lt;BR /&gt;
5&lt;BR /&gt;
...&lt;BR /&gt;
10000&lt;/P&gt;

&lt;P&gt;and I want to fetch the records that includes 1 - 10000 from index A ,B, C then summarize. What makes worse is that there are already millions of events in the index.&lt;/P&gt;

&lt;P&gt;Reason why I was using so many join was all calculation inside the join has different perspectives so it is difficult to calculate in one stat.&lt;/P&gt;

&lt;P&gt;Any ideas of how to filter above ID fastly?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2014 01:33:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178158#M51238</guid>
      <dc:creator>yuwtennis</dc:creator>
      <dc:date>2014-05-27T01:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178159#M51239</link>
      <description>&lt;P&gt;Hi MuS.&lt;/P&gt;

&lt;P&gt;Thank you for the reply.&lt;/P&gt;

&lt;P&gt;I think I would need to clarify my question.&lt;BR /&gt;
What I was intended was I wanted to know how to fetch records including certain values (please see below)&lt;/P&gt;

&lt;P&gt;ID&lt;BR /&gt;
1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
4&lt;BR /&gt;
....&lt;BR /&gt;
10000&lt;/P&gt;

&lt;P&gt;I have a list of above data as lookup and just want to fetch the records including above ID.&lt;/P&gt;

&lt;P&gt;Any idea how to implement this without becoming the search slow?&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2014 01:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178159#M51239</guid>
      <dc:creator>yuwtennis</dc:creator>
      <dc:date>2014-05-27T01:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178160#M51240</link>
      <description>&lt;P&gt;same, easiest way to filter the required value is to tell which are the one not required.&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(index=a AND fieldA!="xyz") OR (...) OR (...)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;P&gt;using lookup&lt;BR /&gt;
&lt;CODE&gt;(index=a AND ([|inputlookup lookup_file.csv|table fieldA]) OR ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;While using subsearch keep in mind there will be truncation if you have more than the defined limit (limits.conf)&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2014 03:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178160#M51240</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-27T03:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178161#M51241</link>
      <description>&lt;P&gt;You should be able to filter event from each index (for specific IDs) as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A [|inputlookup YourIDLookup.csv | table fieldA | format]| MySearch1 .... 
| join type=outer fieldA [ search index=B [|inputlookup YourIDLookup.csv | table fieldA | format] | MySearch2 .... ] 
| join type=outer fieldA [ search index=A [|inputlookup YourIDLookup.csv | table fieldA | format]| MySearch3 .... ] 
| join type=outer fieldA [ search index=C [|inputlookup YourIDLookup.csv | table fieldA | format]| indexMySearch4 .... ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This way each dataset to be joined will already be filtered for your specific IDs. However, there could a better solution (by avoiding joins) if you could provide the details about operations you're doing in each subsearch.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2014 14:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178161#M51241</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-27T14:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data quickly</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178162#M51242</link>
      <description>&lt;P&gt;Hello linu1988.&lt;/P&gt;

&lt;P&gt;Thank you for the reply.&lt;/P&gt;

&lt;P&gt;Since calling thousands of boolean expression causes the search performance extremely slow, I have decided to use the lookup by &lt;BR /&gt;
calling in every join clause.&lt;/P&gt;

&lt;P&gt;Thanks for the advice!&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2014 06:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-data-quickly/m-p/178162#M51242</guid>
      <dc:creator>yuwtennis</dc:creator>
      <dc:date>2014-05-28T06:40:57Z</dc:date>
    </item>
  </channel>
</rss>

