<?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 Modify timespan of a subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Modify-timespan-of-a-subsearch/m-p/21152#M3420</link>
    <description>&lt;P&gt;Hi I’m trying to compare two days in my search, but not the whole day only e.g. from 00:00 till 13:30.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary_dummy" earliest=@d | addinfo | stats sum(count) AS count1, max(search_now) as time1, min(info_min_time) as time2 | eval tspan=(time1-time2)/60 | eval tspan2=round(tspan)| append [search index="summary_dummy" earliest=-2@d  searchtimespanminutes=tspan| addinfo | stats sum(count) AS count2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tested tspan2 with isint() but still get the error  “ tspan2 is not a valid value for searchtimespanminutes. It is not a positive integer.”&lt;BR /&gt;
I think the Problem is that I didn’t pass tspan2 to my subsearch but I’ve no idea how to do that.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Nov 2012 09:24:25 GMT</pubDate>
    <dc:creator>Oti47</dc:creator>
    <dc:date>2012-11-02T09:24:25Z</dc:date>
    <item>
      <title>Modify timespan of a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-timespan-of-a-subsearch/m-p/21152#M3420</link>
      <description>&lt;P&gt;Hi I’m trying to compare two days in my search, but not the whole day only e.g. from 00:00 till 13:30.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary_dummy" earliest=@d | addinfo | stats sum(count) AS count1, max(search_now) as time1, min(info_min_time) as time2 | eval tspan=(time1-time2)/60 | eval tspan2=round(tspan)| append [search index="summary_dummy" earliest=-2@d  searchtimespanminutes=tspan| addinfo | stats sum(count) AS count2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tested tspan2 with isint() but still get the error  “ tspan2 is not a valid value for searchtimespanminutes. It is not a positive integer.”&lt;BR /&gt;
I think the Problem is that I didn’t pass tspan2 to my subsearch but I’ve no idea how to do that.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2012 09:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-timespan-of-a-subsearch/m-p/21152#M3420</guid>
      <dc:creator>Oti47</dc:creator>
      <dc:date>2012-11-02T09:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Modify timespan of a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-timespan-of-a-subsearch/m-p/21153#M3421</link>
      <description>&lt;P&gt;You have it the other way around. A subsearch is evaluated before the outer search, because the results of the subsearch are passed to the outer search as a filter. I'd suggest that your &lt;CODE&gt;search ... searchtimespanminutes=tspan ...&lt;/CODE&gt; be the &lt;EM&gt;outer&lt;/EM&gt; search, with the search setting tspan be the subsearch.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2012 13:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-timespan-of-a-subsearch/m-p/21153#M3421</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-11-02T13:53:43Z</dc:date>
    </item>
  </channel>
</rss>

