<?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 do main search with same time frame of each result of subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498160#M138769</link>
    <description>&lt;P&gt;THanks @to4kawa , This is working for me.. Thanks for your help..&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2020 09:06:39 GMT</pubDate>
    <dc:creator>hariram159</dc:creator>
    <dc:date>2020-05-18T09:06:39Z</dc:date>
    <item>
      <title>How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498145#M138754</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Need to find out suspicious IPs and count of hits (sub search)&lt;/LI&gt;
&lt;LI&gt;use those IPs and do outer search in same time frame of each result of subsearch&lt;/LI&gt;
&lt;LI&gt;show fields of outer search and inner search count&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;index=trace type=success | eval temp=split(ip,",") |eval src=mvindex(temp,0) | search [search index=trace type=blocks | bin span=10m _time |eval temp=split(ip,",") |eval src=mvindex(temp,0)|stats count by src| where count &amp;gt; 50| fields src] | table _time src route&lt;/P&gt;

&lt;P&gt;Now i am getting wrong results because ip is dynamic (once ip used by attacker may be genuine ip at other time, i am getting genuine results of suspicious IP used once - time picker is last 6 months.).. now i want to search outer query in same timeframe of each subsearch result (need to find ip of success type who are blocked more than 50 times at same time)&lt;/P&gt;

&lt;P&gt;Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 19:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498145#M138754</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-16T19:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498146#M138755</link>
      <description>&lt;P&gt;keep subsearch _time, create and use &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 21:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498146#M138755</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-16T21:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498147#M138756</link>
      <description>&lt;P&gt;How?  Can you please mention how to use with query.. I have already tried that but I will try again.. &lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 03:46:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498147#M138756</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-17T03:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498148#M138757</link>
      <description>&lt;P&gt;You're the only one who knows the logs, so you'll have to make the queries.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/527487/can-we-pass-earliest-and-latest-time-in-subsearch.html"&gt;https://answers.splunk.com/answers/527487/can-we-pass-earliest-and-latest-time-in-subsearch.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 06:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498148#M138757</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-17T06:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498149#M138758</link>
      <description>&lt;P&gt;This doesn't helping me out as I have asked.. this is just time picker to search the events... What I want is to match the time for the results obtained in the sub search with the time in main search to ensure those are actual events occurred at that time.&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 06:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498149#M138758</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-17T06:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498150#M138759</link>
      <description>&lt;P&gt;I agree with @to4kawa  you need to use the &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; properties in your searches.&lt;/P&gt;

&lt;P&gt;You may try using your search below and add values for earliest and latest as per the need, so they both run for same time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=trace type=success earliest=-7d@d latest= now() | eval temp=split(ip,",") |eval src=mvindex(temp,0) | search [search index=trace type=blocks earliest=-7d@d latest= now()  | bin span=10m _time |eval temp=split(ip,",") |eval src=mvindex(temp,0)|stats count by src| where count &amp;gt; 50| fields src] | table _time src route
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 May 2020 07:33:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498150#M138759</guid>
      <dc:creator>sanjeev543</dc:creator>
      <dc:date>2020-05-17T07:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498151#M138760</link>
      <description>&lt;P&gt;This will run outer search and sub search at same time range but this is not I want. &lt;BR /&gt;
Suppose 1.1.1.1 is suspicious ip returned by subsearch occurred at 4/16/2020 21:00:00 then outer search has to search for 1.1.1.1 around  4/16/2020 20:55:00 to 4/16/2020 21:05:00.. similarly for other results of subsearch. &lt;BR /&gt;
What I am getting is 1.1.1.1 is getting searched across all the time and getting wrong results as it might be genuine ip other time&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 14:09:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498151#M138760</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-17T14:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498152#M138761</link>
      <description>&lt;P&gt;&lt;CODE&gt;How to do main search with same time frame of each result of subsearch&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Your comment is not the same as your question. Please correct as appropriate.&lt;/P&gt;

&lt;P&gt;and, you should use &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;This doesn't helping me out as I have asked..&lt;/CODE&gt; &lt;BR /&gt;
read carefully&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 21:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498152#M138761</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-17T21:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498153#M138762</link>
      <description>&lt;P&gt;I hope I have posted with right title only... "Main search should happen at same time &lt;STRONG&gt;for each result of subsearch&lt;/STRONG&gt;"&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 03:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498153#M138762</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-18T03:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498154#M138763</link>
      <description>&lt;P&gt;sample(try time picker &lt;EM&gt;24hours ago&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access 
    [ search index=_audit "_internal" 
    | eval earliest=relative_time(_time,"-5min@min"), latest=relative_time(_time,"+5min@min") 
    | streamstats count 
    | where count=1 OR count=100
    | fields earliest latest 
    | format]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you use &lt;CODE&gt;format&lt;/CODE&gt;, you can pass multiple results of a sub search like this.&lt;/P&gt;

&lt;P&gt;Note: that if you also pass values for fields other than &lt;EM&gt;earliest&lt;/EM&gt; and &lt;EM&gt;latest&lt;/EM&gt;, you need to change the &lt;CODE&gt;format&lt;/CODE&gt; args slightly.&lt;/P&gt;

&lt;P&gt;reference: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 04:01:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498154#M138763</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-18T04:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498155#M138764</link>
      <description>&lt;P&gt;Let me try&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 04:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498155#M138764</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-18T04:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498156#M138765</link>
      <description>&lt;P&gt;as per doc i am returning as |fields src, earliest, latest ,  now it will work for outer search as below right for each result of subsearch ?&lt;/P&gt;

&lt;P&gt;| outer query ("src1" AND earliest="earliest1" AND latest="latest1") OR ("src2" AND earliest="earliest2" AND latest="latest2")......&lt;/P&gt;

&lt;P&gt;is this assumption right ?&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 06:32:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498156#M138765</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-18T06:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498157#M138766</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd*
| eval earliest=_time-10, latest=_time+10 
| fields source earliest latest
| tail 2
| format
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;check sub search only.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 07:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498157#M138766</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-18T07:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498158#M138767</link>
      <description>&lt;P&gt;yeah i do checked the subsearch only, i am getting the format as i assumed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
but earlier and latest are returned as epoch times, i hope those also will work fine.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 07:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498158#M138767</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-18T07:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498159#M138768</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SearchTimeModifiers"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/SearchTimeModifiers&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Epoch time is no problem.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 07:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498159#M138768</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-18T07:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498160#M138769</link>
      <description>&lt;P&gt;THanks @to4kawa , This is working for me.. Thanks for your help..&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 09:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498160#M138769</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-05-18T09:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498161#M138770</link>
      <description>&lt;P&gt;Please post your final query so others can see it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 09:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498161#M138770</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-18T09:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498162#M138771</link>
      <description>&lt;P&gt;Here is my final query..&lt;/P&gt;

&lt;P&gt;index=trace type=success | eval temp=split(ip,",") |eval src=mvindex(temp,0) | search [search index=trace type=blocks | bin span=10m _time |eval temp=split(ip,",") |eval src=mvindex(temp,0)| eval earliest=relative_time(_time,"-5min@min"), latest=relative_time(_time,"+5min@min") | streamstats count by src  | where count &amp;gt; 50 | fields src,earliest,latest |format] | table _time src id | sort -_time&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498162#M138771</guid>
      <dc:creator>hariram159</dc:creator>
      <dc:date>2020-09-30T05:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to do main search with same time frame of each result of subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498163#M138772</link>
      <description>&lt;P&gt;thanks @hariram159 &lt;BR /&gt;
Happy splunking!&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 09:24:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-main-search-with-same-time-frame-of-each-result-of/m-p/498163#M138772</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-18T09:24:45Z</dc:date>
    </item>
  </channel>
</rss>

