<?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 to use search from summary index as a condition in another search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379916#M111233</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have  &lt;CODE&gt;index="ekra_protokol"&lt;/CODE&gt; which has these events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;datum_zeit;meldung
2019-06-19 05:56:26.754: Test Drucken ...
2019-06-19 05:56:37.629: Test Drucken ...
2019-06-19 05:56:48.570: Test Drucken ...
2019-06-19 05:56:59.516: Test Drucken ...
2019-06-19 05:57:10.436: Test Drucken ...
2019-06-19 05:58:10.436: Test Drucken ...
2019-06-20 05:56:59.516: Test Drucken ...
2019-06-20 05:57:10.436: Test Drucken ...
2019-06-20 05:58:10.436: Test Drucken ...
2019-06-20 05:58:32.436: Test Drucken ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a saved search, which is running every 5min. This saved search collects all outputs into a summary search. In fact, it is saving the timestamp datum_zeit when the counter meldung="Test Drucken" multiples 3.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ekra_protokol" meldung="Test Drucken ..." 
| sort 0 datum_zeit
| autoregress meldung as meldung_old
| eval cnt=0
| autoregress cnt as cnt_old
| eval cnt = if(meldung=meldung_old,cnt_old+1,cnt_old)
| table datum_zeit meldung cnt cnt_old
| streamstats count(eval(cnt==1)) as conecutive_change
| fields - cnt cnt_old
| eval cnt=conecutive_change+1
| fields - conecutive_change
| eval decimal=(cnt%3)/3
| eval action=if(decimal=0,1,0)
| where action==1
| sitop datum_zeit
| stats max(datum_zeit) as datum_zeit_summary 
| fields datum_zeit_summary
| addinfo
| collect index=ekra_protokol_rakel_summary testmode=false marker="populated_ekra_protokol_rakel_summary"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The summary index ekra_protokol_rakel_summary has 3 rows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;datum_zeit_summary
2019-06-19 05:56:48.570
2019-06-19 05:58:10.436
2019-06-20 05:58:10.436
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These are offline data. But I want to switch into a situation, when the events will be indexed through forwarder and the counterReset will be 40000 and the saved search will run each hour.&lt;/P&gt;

&lt;P&gt;I want to run the saved search exactly from the point, where the counter reached his limit. So each saved search should search only events where datum_zeit&amp;gt; stats max(datum_zeit_summary) as NewTime.&lt;/P&gt;

&lt;P&gt;The problem is, that I don´t know, how to use the value of any search of the summary index in the saved search.&lt;BR /&gt;
I expect somethin like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ekra_protokol" meldung="Test Drucken ..." 
**| datum_zeit&amp;gt; stats max(datum_zeit_summary) as NewTime**
| sort 0 datum_zeit
| autoregress meldung as meldung_old
| eval cnt=0
| autoregress cnt as cnt_old
| eval cnt = if(meldung=meldung_old,cnt_old+1,cnt_old)
| table datum_zeit meldung cnt cnt_old
| streamstats count(eval(cnt==1)) as conecutive_change
| fields - cnt cnt_old
| eval cnt=conecutive_change+1
| fields - conecutive_change
| eval decimal=(cnt%3)/3
| eval action=if(decimal=0,1,0)
| where action==1
| sitop datum_zeit
| stats max(datum_zeit) as datum_zeit_summary 
| fields datum_zeit_summary
| addinfo
| collect index=ekra_protokol_rakel_summary testmode=false marker="populated_ekra_protokol_rakel_summary"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anybody help, please?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:14:48 GMT</pubDate>
    <dc:creator>spisiakmi</dc:creator>
    <dc:date>2020-09-30T01:14:48Z</dc:date>
    <item>
      <title>How to use search from summary index as a condition in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379916#M111233</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have  &lt;CODE&gt;index="ekra_protokol"&lt;/CODE&gt; which has these events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;datum_zeit;meldung
2019-06-19 05:56:26.754: Test Drucken ...
2019-06-19 05:56:37.629: Test Drucken ...
2019-06-19 05:56:48.570: Test Drucken ...
2019-06-19 05:56:59.516: Test Drucken ...
2019-06-19 05:57:10.436: Test Drucken ...
2019-06-19 05:58:10.436: Test Drucken ...
2019-06-20 05:56:59.516: Test Drucken ...
2019-06-20 05:57:10.436: Test Drucken ...
2019-06-20 05:58:10.436: Test Drucken ...
2019-06-20 05:58:32.436: Test Drucken ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a saved search, which is running every 5min. This saved search collects all outputs into a summary search. In fact, it is saving the timestamp datum_zeit when the counter meldung="Test Drucken" multiples 3.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ekra_protokol" meldung="Test Drucken ..." 
| sort 0 datum_zeit
| autoregress meldung as meldung_old
| eval cnt=0
| autoregress cnt as cnt_old
| eval cnt = if(meldung=meldung_old,cnt_old+1,cnt_old)
| table datum_zeit meldung cnt cnt_old
| streamstats count(eval(cnt==1)) as conecutive_change
| fields - cnt cnt_old
| eval cnt=conecutive_change+1
| fields - conecutive_change
| eval decimal=(cnt%3)/3
| eval action=if(decimal=0,1,0)
| where action==1
| sitop datum_zeit
| stats max(datum_zeit) as datum_zeit_summary 
| fields datum_zeit_summary
| addinfo
| collect index=ekra_protokol_rakel_summary testmode=false marker="populated_ekra_protokol_rakel_summary"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The summary index ekra_protokol_rakel_summary has 3 rows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;datum_zeit_summary
2019-06-19 05:56:48.570
2019-06-19 05:58:10.436
2019-06-20 05:58:10.436
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These are offline data. But I want to switch into a situation, when the events will be indexed through forwarder and the counterReset will be 40000 and the saved search will run each hour.&lt;/P&gt;

&lt;P&gt;I want to run the saved search exactly from the point, where the counter reached his limit. So each saved search should search only events where datum_zeit&amp;gt; stats max(datum_zeit_summary) as NewTime.&lt;/P&gt;

&lt;P&gt;The problem is, that I don´t know, how to use the value of any search of the summary index in the saved search.&lt;BR /&gt;
I expect somethin like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ekra_protokol" meldung="Test Drucken ..." 
**| datum_zeit&amp;gt; stats max(datum_zeit_summary) as NewTime**
| sort 0 datum_zeit
| autoregress meldung as meldung_old
| eval cnt=0
| autoregress cnt as cnt_old
| eval cnt = if(meldung=meldung_old,cnt_old+1,cnt_old)
| table datum_zeit meldung cnt cnt_old
| streamstats count(eval(cnt==1)) as conecutive_change
| fields - cnt cnt_old
| eval cnt=conecutive_change+1
| fields - conecutive_change
| eval decimal=(cnt%3)/3
| eval action=if(decimal=0,1,0)
| where action==1
| sitop datum_zeit
| stats max(datum_zeit) as datum_zeit_summary 
| fields datum_zeit_summary
| addinfo
| collect index=ekra_protokol_rakel_summary testmode=false marker="populated_ekra_protokol_rakel_summary"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anybody help, please?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:14:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379916#M111233</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2020-09-30T01:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search from summary index as a condition in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379917#M111234</link>
      <description>&lt;P&gt;Your translation to English is a little difficult for me to understand but I think you are asking how to tokenize a saved search to accept arguments and that really is a thing!  See here if this helps:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Savedsearch"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Savedsearch&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2019 21:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379917#M111234</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-06T21:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search from summary index as a condition in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379918#M111235</link>
      <description>&lt;P&gt;Hi woodcock, thank you very much for your help. Finally I found a solution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="ekra_protokol_rakel_summary" 
| stats max(datum_zeit_summary) as NewTime 
| append [search index="ekra_protokol" meldung="Test Drucken ..." 
| sort 0 datum_zeit] 
| eventstats max(NewTime) as NewTime
| where datum_zeit&amp;gt;NewTime 
| autoregress meldung as meldung_old
| eval cnt=0
| autoregress cnt as cnt_old
| eval cnt = if(meldung=meldung_old,cnt_old+1,cnt_old)
| table datum_zeit meldung cnt cnt_old
| streamstats count(eval(cnt==1)) as conecutive_change
| fields - cnt cnt_old
| eval cnt=conecutive_change+1
| fields - conecutive_change
| eval decimal=(cnt%3)/3
| eval action=if(decimal=0,1,0)
| where action==1
| sitop datum_zeit
| stats max(datum_zeit) as datum_zeit_summary 
| fields datum_zeit_summary
| addinfo
| collect index=ekra_protokol_rakel_summary testmode=false marker="populated_ekra_protokol_rakel_summary"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379918#M111235</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2019-07-10T12:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search from summary index as a condition in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379919#M111236</link>
      <description>&lt;P&gt;@spisiakmi If your problem is resolved, please accept an answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 12:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379919#M111236</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-11T12:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search from summary index as a condition in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379920#M111237</link>
      <description>&lt;P&gt;Kudos to you for coming back and sharing your solution.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 14:51:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379920#M111237</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-11T14:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use search from summary index as a condition in another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379921#M111238</link>
      <description>&lt;P&gt;Always my pleasure.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 14:59:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-search-from-summary-index-as-a-condition-in-another/m-p/379921#M111238</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2019-07-11T14:59:37Z</dc:date>
    </item>
  </channel>
</rss>

