<?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 do I run loadjob to get the second to last resultset? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270793#M5194</link>
    <description>&lt;P&gt;easiest way to get the second last result-set should be, below is the default syntax for load job.&lt;BR /&gt;
 | loadjob (sid | savedsearch) [result-event] [delegate] [artifact_offset] [ignore_running]&lt;/P&gt;

&lt;P&gt;Selects a search artifact other than the most recent matching one. For example, if artifact_offset=1, the second most recent artifact will be used. If artifact_offset=2, the third most recent artifact will be used.&lt;BR /&gt;
FYI= &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Loadjob" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Loadjob&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:11:17 GMT</pubDate>
    <dc:creator>splunkuseradmin</dc:creator>
    <dc:date>2020-09-30T01:11:17Z</dc:date>
    <item>
      <title>How do I run loadjob to get the second to last resultset?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270791#M5192</link>
      <description>&lt;P&gt;How do I run loadjob to get the second to last resultset? By default it gives the last resultset.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2015 10:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270791#M5192</guid>
      <dc:creator>hylam</dc:creator>
      <dc:date>2015-12-12T10:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I run loadjob to get the second to last resultset?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270792#M5193</link>
      <description>&lt;P&gt;Hi hylam,&lt;/P&gt;

&lt;P&gt;if your saved search is named &lt;CODE&gt;foo&lt;/CODE&gt; you can us this command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob [ 
          search index=_audit savedsearch_name="foo" search_id='scheduler_*' 
          | sort - _time | head 2 | tail 1 
          | rename search_id AS search 
          | eval search=replace(search, "\'","") ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What happens here? The sub search will search for the &lt;CODE&gt;search_id&lt;/CODE&gt; of your saved searches, the &lt;CODE&gt;sort&lt;/CODE&gt; and &lt;CODE&gt;head&lt;/CODE&gt; and &lt;CODE&gt;tail&lt;/CODE&gt; will get back the second last result and the &lt;CODE&gt;rename&lt;/CODE&gt; and eval will return the values in a useable format for &lt;CODE&gt;loadjob&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 20:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270792#M5193</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-12-13T20:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I run loadjob to get the second to last resultset?</title>
      <link>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270793#M5194</link>
      <description>&lt;P&gt;easiest way to get the second last result-set should be, below is the default syntax for load job.&lt;BR /&gt;
 | loadjob (sid | savedsearch) [result-event] [delegate] [artifact_offset] [ignore_running]&lt;/P&gt;

&lt;P&gt;Selects a search artifact other than the most recent matching one. For example, if artifact_offset=1, the second most recent artifact will be used. If artifact_offset=2, the third most recent artifact will be used.&lt;BR /&gt;
FYI= &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Loadjob" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/Loadjob&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/How-do-I-run-loadjob-to-get-the-second-to-last-resultset/m-p/270793#M5194</guid>
      <dc:creator>splunkuseradmin</dc:creator>
      <dc:date>2020-09-30T01:11:17Z</dc:date>
    </item>
  </channel>
</rss>

