<?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 How can I efficiently diff results of two searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150469#M42158</link>
    <description>&lt;P&gt;Imagine I have a bunch of indexes named app1, app2, app3, .... appN.  Assuming I have search permissions on all of them, then I can run the following search to quickly (1 sec) get a list of existing app# indexes. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventcount summarize=f index=app* | eval index_app=index | stats count by index_app 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems like daily someone creates a new app and doesn't bother to tell me. The way I deal with this is to reroute log events from unknown apps in a CatchAll index.  Periodically I want to look at what is in the catchall index to see what new apps exist. &lt;/P&gt;

&lt;P&gt;This search works to get a list of apps that appear in the catch all index...taking only a couple seconds to run over the last few days&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=CatchAll | rex field=_raw "index=\"(?&amp;lt;index_app&amp;gt;\w+)\"" | dedup index_app
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So one search gives me the list of existing app indexes and the other is a set of app indexes which may include new ones.&lt;/P&gt;

&lt;P&gt;My goal is to figure out app indexes I need to create, and it seems like I should be able use these two searches together to get the answer quickly.  &lt;/P&gt;

&lt;P&gt;I tried to combine &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=CatchAll | rex field=_raw "index=\"(?&amp;lt;index_app&amp;gt;\w+)\"" | dedup index_app |join left [| eventcount summarize=f index=app* | eval index_app=index | stats count by index_app]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this both doesn't seem to work and is super slow. &lt;/P&gt;

&lt;P&gt;It's strange because it seems like it should be 2 seconds for the first search, then 2 seconds for the second, and a fraction to diff them.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2014 05:53:48 GMT</pubDate>
    <dc:creator>juniormint</dc:creator>
    <dc:date>2014-02-14T05:53:48Z</dc:date>
    <item>
      <title>How can I efficiently diff results of two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150469#M42158</link>
      <description>&lt;P&gt;Imagine I have a bunch of indexes named app1, app2, app3, .... appN.  Assuming I have search permissions on all of them, then I can run the following search to quickly (1 sec) get a list of existing app# indexes. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventcount summarize=f index=app* | eval index_app=index | stats count by index_app 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems like daily someone creates a new app and doesn't bother to tell me. The way I deal with this is to reroute log events from unknown apps in a CatchAll index.  Periodically I want to look at what is in the catchall index to see what new apps exist. &lt;/P&gt;

&lt;P&gt;This search works to get a list of apps that appear in the catch all index...taking only a couple seconds to run over the last few days&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=CatchAll | rex field=_raw "index=\"(?&amp;lt;index_app&amp;gt;\w+)\"" | dedup index_app
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So one search gives me the list of existing app indexes and the other is a set of app indexes which may include new ones.&lt;/P&gt;

&lt;P&gt;My goal is to figure out app indexes I need to create, and it seems like I should be able use these two searches together to get the answer quickly.  &lt;/P&gt;

&lt;P&gt;I tried to combine &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=CatchAll | rex field=_raw "index=\"(?&amp;lt;index_app&amp;gt;\w+)\"" | dedup index_app |join left [| eventcount summarize=f index=app* | eval index_app=index | stats count by index_app]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this both doesn't seem to work and is super slow. &lt;/P&gt;

&lt;P&gt;It's strange because it seems like it should be 2 seconds for the first search, then 2 seconds for the second, and a fraction to diff them.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 05:53:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150469#M42158</guid>
      <dc:creator>juniormint</dc:creator>
      <dc:date>2014-02-14T05:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently diff results of two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150470#M42159</link>
      <description>&lt;P&gt;If you only need to find which indexes that have not been created properly, you could check for these events in the "_internal" index;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02-14-2014 09:40:57.755 +0100 WARN  IndexProcessor - received event for unconfigured/disabled/deleted index='some_index_name' with source='source::c:\temp\blah.log' host='host::ServerX' sourcetype='sourcetype::bleh' (1 missing total)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 08:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150470#M42159</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-02-14T08:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently diff results of two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150471#M42160</link>
      <description>&lt;P&gt;Kristian,  thanks for your idea...definitely a good way to find unconfigured indexes directly. I think I am still interested in diffing the two sets for my particular use case (I don't get these unconfigured/disabled index events)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2014 12:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150471#M42160</guid>
      <dc:creator>juniormint</dc:creator>
      <dc:date>2014-02-14T12:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I efficiently diff results of two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150472#M42161</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [| eventcount summarize=f index=app* | eval index_app=index | stats count by index_app | fields - count] [search index=CatchAll | rex field=_raw "index=\"(?&amp;lt;index_app&amp;gt;\w+)\"" | dedup index_app]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2014 21:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-efficiently-diff-results-of-two-searches/m-p/150472#M42161</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-14T21:32:12Z</dc:date>
    </item>
  </channel>
</rss>

