<?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 export results from makeresult in query body ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377272#M94943</link>
    <description>&lt;P&gt;As per my understanding, u want to generate earliest and latest epochs from makeresult query and want to pass it to your index query.&lt;BR /&gt;
Please try this code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
     | eval time = relative_time(now(),"-h@w1") 
     | eval format = strftime(time, "%m/%d/%Y:%H:%M:%S") 
     | eval earliest=strptime(format,"%m/%d/%Y") 
     | eval latest=relative_time(earliest,"+24h@h") | table earliest latest 
     | map maxsearches=1000 search="search index=en_amp_api earliest=$earliest$ latest=$latest$ | table &amp;lt;list of fields&amp;gt; "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if it work.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 06:59:10 GMT</pubDate>
    <dc:creator>jitendragupta</dc:creator>
    <dc:date>2019-07-12T06:59:10Z</dc:date>
    <item>
      <title>How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377264#M94935</link>
      <description>&lt;P&gt;For example I have this query: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=en_amp_api 
    [ | makeresults 
    | eval time = relative_time(now(),"-h@w1") 
    | eval format = strftime(time, "%m/%d/%Y:%H:%M:%S") 
    | eval earliest=strptime(format,"%m/%d/%Y") 
    | eval latest=relative_time(earliest,"+24h@h") 
| table earliest latest ]
| table earliest, latest
| ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I see values of earliest and latest with table only [ ... ], but I can not see values after closing brackets !&lt;/P&gt;

&lt;P&gt;I wont to see the value after closing brackets ! How is that possible?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 14:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377264#M94935</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-11T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377265#M94936</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190803"&gt;@malear_ion&lt;/a&gt; Do you have any earliest and latest field in your index en_amp_api ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377265#M94936</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2020-09-30T01:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377266#M94937</link>
      <description>&lt;P&gt;No, is a replacement of search parameters &lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 15:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377266#M94937</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-11T15:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377267#M94938</link>
      <description>&lt;P&gt;For example :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=en_amp_api earliest=@w1 latest=@w2 | table hostname, last_seen
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's the same !&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 15:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377267#M94938</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-11T15:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377268#M94939</link>
      <description>&lt;P&gt;What is it with pictures lately? I wish answers would disable that.  We need your raw text so that we can work with it.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377268#M94939</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-11T20:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377269#M94940</link>
      <description>&lt;P&gt;To answer your question, see here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/689333/earliest-is-the-maxtimestamp-from-an-inputlookup.html"&gt;https://answers.splunk.com/answers/689333/earliest-is-the-maxtimestamp-from-an-inputlookup.html&lt;/A&gt;&lt;BR /&gt;
But that is overkill, just do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=en_amp_api earliest=-h@w1 latest=-h@w1+24h@h
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377269#M94940</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-11T20:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377270#M94941</link>
      <description>&lt;P&gt;Sorry, I understand&lt;BR /&gt;
I will make changes !&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 06:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377270#M94941</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-12T06:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377271#M94942</link>
      <description>&lt;P&gt;I need to change values: earliest and latest in different cases, so I can not set the search parameters after the index .&lt;BR /&gt;
I need to change by setting the higher or lower value,  search for different cases runs at the time indicated by earliest and latest.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 06:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377271#M94942</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-12T06:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377272#M94943</link>
      <description>&lt;P&gt;As per my understanding, u want to generate earliest and latest epochs from makeresult query and want to pass it to your index query.&lt;BR /&gt;
Please try this code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
     | eval time = relative_time(now(),"-h@w1") 
     | eval format = strftime(time, "%m/%d/%Y:%H:%M:%S") 
     | eval earliest=strptime(format,"%m/%d/%Y") 
     | eval latest=relative_time(earliest,"+24h@h") | table earliest latest 
     | map maxsearches=1000 search="search index=en_amp_api earliest=$earliest$ latest=$latest$ | table &amp;lt;list of fields&amp;gt; "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if it work.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 06:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377272#M94943</guid>
      <dc:creator>jitendragupta</dc:creator>
      <dc:date>2019-07-12T06:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377273#M94944</link>
      <description>&lt;P&gt;Unfortunately, the proposed solution does not work ...&lt;BR /&gt;
I have different case:&lt;/P&gt;

&lt;P&gt;| eval this_week = case(last_seen &amp;lt; strftime(relative_time(now(), "-mon"), "%Y-%m-%dT%H:%M:%SZ"), "1 Month") &lt;BR /&gt;
 | eval 1_week_ago = case( last_seen &amp;lt; strftime(relative_time(now() "-2mon"), "%Y-%m-%dT%H:%M:%SZ"), "2 Month") &lt;BR /&gt;
Now: 7/12/19 10:30:00.000 AM&lt;BR /&gt;
I need search first case in interval of time 7/8/19 00:00:00.000 AM - 7/9/19 00:00:00.000 AM&lt;BR /&gt;
The second case in interval of time 7/1/19 00:00:00.000 AM - 7/2/19 00:00:00.000 AM&lt;/P&gt;

&lt;P&gt;How it's possible ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:17:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377273#M94944</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2020-09-30T01:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377274#M94945</link>
      <description>&lt;P&gt;I have different case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | eval this_week = case(last_seen &amp;lt; strftime(relative_time(now(), "-mon"), "%Y-%m-%dT%H:%M:%SZ"), "1 Month") 
    | eval 1_week_ago = case( last_seen &amp;lt; strftime(relative_time(now() "-2mon"), "%Y-%m-%dT%H:%M:%SZ"), "2 Month") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now: 7/12/19 10:30:00.000 AM&lt;BR /&gt;
I need search first case in interval of time 7/8/19 00:00:00.000 AM - 7/9/19 00:00:00.000 AM&lt;BR /&gt;
The second case in interval of time 7/1/19 00:00:00.000 AM - 7/2/19 00:00:00.000 AM&lt;/P&gt;

&lt;P&gt;How it's possible ?&lt;/P&gt;

&lt;P&gt;With search parameter earliest and latest it's impossible,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=en_amp_api earliest=@w1 latest=@w2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;because the search work only on first case.&lt;BR /&gt;
That's why I try something this to do earliest and latest as variables.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 08:22:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377274#M94945</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-12T08:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377275#M94946</link>
      <description>&lt;P&gt;I have different case:&lt;/P&gt;

&lt;P&gt;| eval this_week = case(last_seen &amp;lt; strftime(relative_time(now(), "-mon"), "%Y-%m-%dT%H:%M:%SZ"), "1 Month") &lt;BR /&gt;
 | eval 1_week_ago = case( last_seen &amp;lt; strftime(relative_time(now() "-2mon"), "%Y-%m-%dT%H:%M:%SZ"), "2 Month") &lt;BR /&gt;
Now: 7/12/19 10:30:00.000 AM&lt;BR /&gt;
I need search first case in interval of time 7/8/19 00:00:00.000 AM - 7/9/19 00:00:00.000 AM&lt;BR /&gt;
The second case in interval of time 7/1/19 00:00:00.000 AM - 7/2/19 00:00:00.000 AM&lt;/P&gt;

&lt;P&gt;How it's possible ?&lt;/P&gt;

&lt;P&gt;With search parameter earliest and latest it's impossible,&lt;/P&gt;

&lt;P&gt;index=en_amp_api earliest=@w1 latest=@w2&lt;BR /&gt;
because the search work only on first case.&lt;/P&gt;

&lt;P&gt;I try something this to do earliest and latest as variables:&lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
     | eval time = relative_time(now(),"-h@w1") &lt;BR /&gt;
     | eval format = strftime(time, "%m/%d/%Y:%H:%M:%S") &lt;BR /&gt;
     | eval earliest = strptime(format,"%m/%d/%Y") &lt;BR /&gt;
     | eval latest = relative_time(earliest,"+24h@h") &lt;BR /&gt;
     | eval format_earliest = strftime(earliest,"%m/%d/%Y %H:%M:%S")&lt;BR /&gt;
     | eval format_latest = strftime(latest,"%m/%d/%Y %H:%M:%S")&lt;BR /&gt;
 | table format_earliest format_latest&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377275#M94946</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2020-09-30T01:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377276#M94947</link>
      <description>&lt;P&gt;Unfortunately, the proposed solution does not work&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 08:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377276#M94947</guid>
      <dc:creator>malear_ion</dc:creator>
      <dc:date>2019-07-12T08:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377277#M94948</link>
      <description>&lt;P&gt;What is the error you are getting? Please provide some screenshot.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 08:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377277#M94948</guid>
      <dc:creator>jitendragupta</dc:creator>
      <dc:date>2019-07-12T08:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to export results from makeresult in query body ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377278#M94949</link>
      <description>&lt;P&gt;Give us TWO FULL examples of what you are trying to do starting with the raw event data and ending with a mockup of the final results, with detailed pseudocode descriptions of the steps required.  I have no idea what you mean by this comment.  It very much seems like you are going about this completely the wrong way.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 15:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-export-results-from-makeresult-in-query-body/m-p/377278#M94949</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-15T15:56:13Z</dc:date>
    </item>
  </channel>
</rss>

