<?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: Get info_min_time and info_max_time  of from main search into subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/621995#M216198</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250227"&gt;@simon_b&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it isn't possible to pass parameters from tha main search to a sub search, you should charge the logic of your search.&lt;/P&gt;&lt;P&gt;But, what the reason to do that?&lt;/P&gt;&lt;P&gt;maybe you could create a main search with two parts containing main search and subsearch.&lt;/P&gt;&lt;P&gt;e.g. something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(&amp;lt;search1&amp;gt;) OR (&amp;lt;search2&amp;gt; earliest=-7d latest=now)
| addinfo
| ...&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 11:34:16 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-11-24T11:34:16Z</dc:date>
    <item>
      <title>Is it possible to get info_min_time and info_max_time  of from main search into subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/621993#M216196</link>
      <description>&lt;P&gt;Hi, let me try to explain my problem. I have a main search with a selected timerange (typically "last 4 hours") which is selected with the time picker. In addition, I join a subsearch where I want to calculate the average of some values with a bigger time range (typically "last 7 days"). To do that I use the earliest and latest commands in the subsearch.&lt;/P&gt;
&lt;P&gt;Is it somehow possible to get/access the values of info_min_time and&amp;nbsp;info_max_time (which the addinfo command produces) from the main search into the subsearch?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:56:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/621993#M216196</guid>
      <dc:creator>simon_b</dc:creator>
      <dc:date>2022-11-29T13:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/621995#M216198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250227"&gt;@simon_b&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it isn't possible to pass parameters from tha main search to a sub search, you should charge the logic of your search.&lt;/P&gt;&lt;P&gt;But, what the reason to do that?&lt;/P&gt;&lt;P&gt;maybe you could create a main search with two parts containing main search and subsearch.&lt;/P&gt;&lt;P&gt;e.g. something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(&amp;lt;search1&amp;gt;) OR (&amp;lt;search2&amp;gt; earliest=-7d latest=now)
| addinfo
| ...&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 11:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/621995#M216198</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-24T11:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622401#M216342</link>
      <description>&lt;P&gt;Grazie &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&lt;SPAN&gt;&amp;nbsp;per la risposta.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Unfortunately the solution doesn't work for my case. As I explained, in the subsearch I would like to calculate the average for a value, but only for the specified hours of the main search in the last 7 days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example: If my main search looks at the data from 06:00 to 10:00 for today I want to calculate the average for the last 7 days also only for the hours 06:00 to 10:00 from each day.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 12:46:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622401#M216342</guid>
      <dc:creator>simon_b</dc:creator>
      <dc:date>2022-11-29T12:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622403#M216344</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250227"&gt;@simon_b&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to add an eval command to identify the values to consider, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval interesting_value=if(date_hour&amp;gt;5 AND date_hour&amp;lt;11,"value,"")
| timechart avg(intersting_value) AS average&lt;/LI-CODE&gt;&lt;P&gt;in few words, you have to create a field that consider only the values in the hours you need (6.00-10.00) and then calculate avg on this field.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 12:51:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622403#M216344</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-29T12:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622407#M216348</link>
      <description>&lt;P&gt;Ciao&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes I know how to do that. The problem is that I need the timerange of the main search to filter for that hours in the subsearch.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:24:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622407#M216348</guid>
      <dc:creator>simon_b</dc:creator>
      <dc:date>2022-11-29T13:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622412#M216351</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250227"&gt;@simon_b&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;don't think in terms of subsearch, create your search using parenthesis in the main search and the eval to take only the values you need.&lt;/P&gt;&lt;P&gt;If you could share your search in terms of rules and desidered output not considering syntax?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 13:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622412#M216351</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-29T13:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622420#M216358</link>
      <description>&lt;P&gt;It does not work this way.&lt;/P&gt;&lt;P&gt;Subsearches (in the most typical form) are not "called" from the main search. The subsearch is run first then its results are passed into the main search rendered accorting to the explicit or implicit return command.&lt;/P&gt;&lt;P&gt;So the subsearch runs with the timepicker-set search boundaries or the earliest/latest explicitly stated parameters. There is no way of "passing variables" from the main search to a subsearch.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 14:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622420#M216358</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-11-29T14:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622429#M216364</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;, the search at the moment looks something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1
| regex id != "2|3|4" 
| join id
    [ search index=index2 latest=-0d earliest=-7d
    | regex id != "2|3|4" 

    ***some eval commands***

    | where (date_hour&amp;gt;hour_min) AND (date_hour&amp;lt;hour_max) 
    | stats mean(value1) AS "mean_value1" by id]
| table _time id mean_value1&lt;/LI-CODE&gt;&lt;P&gt;The parameters I need in the subsearch are "hour_min" and "hour_max" which represent the earliest and latest hour of the main searches time picker.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 14:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622429#M216364</guid>
      <dc:creator>simon_b</dc:creator>
      <dc:date>2022-11-29T14:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622435#M216368</link>
      <description>&lt;P&gt;Don't use join if you absolutely don't have to.&lt;/P&gt;&lt;P&gt;It seems that you're not "thinking in SPL" yet &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You usually can get around the joining thing with cleverly constructed stats.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 15:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622435#M216368</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-11-29T15:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get info_min_time and info_max_time  of from main search into subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622449#M216371</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250227"&gt;@simon_b&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could reverse the join, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index2 latest=-0d earliest=-7d
    | regex id != "2|3|4" 

    ***some eval commands***
| join id
    [ search index=index1 | regex id != "2|3|4" | addinfo]
    | where (date_hour&amp;gt;hour_min) AND (date_hour&amp;lt;hour_max) 
    | stats mean(value1) AS "mean_value1" by id
| table _time id mean_value1&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 15:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-get-info-min-time-and-info-max-time-of-from/m-p/622449#M216371</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-29T15:51:59Z</dc:date>
    </item>
  </channel>
</rss>

