<?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 pass the earliest ,latest time and span as arguments to the curl command to query a saved search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53620#M13033</link>
    <description>&lt;P&gt;Thanks mate&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2013 20:02:09 GMT</pubDate>
    <dc:creator>bubby248</dc:creator>
    <dc:date>2013-03-13T20:02:09Z</dc:date>
    <item>
      <title>How to pass the earliest ,latest time and span as arguments to the curl command to query a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53618#M13031</link>
      <description>&lt;P&gt;I had the curl statement as below&lt;/P&gt;

&lt;P&gt;curl -u username:password -k &lt;A href="https://hostname:8089/services/search/jobs" target="_blank"&gt;https://hostname:8089/services/search/jobs&lt;/A&gt; -d"search=| savedsearch mysavedsearch" -earliest_time="-24h@h" -latest_time="now" -d span="1hr"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;But the response is as below&lt;/STRONG&gt;&lt;BR /&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;
&lt;RESPONSE&gt;&lt;BR /&gt;
  &lt;MESSAGES&gt;&lt;BR /&gt;
    &lt;MSG type="FATAL"&gt;Error in 'savedsearch' command: Encountered the following error while building a search for saved search 'mysavedsearch': Error while replacing variable name='earliest'. Could not find variable in the argument map.&lt;/MSG&gt;&lt;BR /&gt;
  &lt;/MESSAGES&gt;&lt;BR /&gt;
&lt;/RESPONSE&gt;&lt;/P&gt;

&lt;P&gt;Can you please help me out with the curl command&lt;BR /&gt;
With this am expecting an SID, once I get the SID I will try to retreive the results.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53618#M13031</guid>
      <dc:creator>bubby248</dc:creator>
      <dc:date>2020-09-28T13:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the earliest ,latest time and span as arguments to the curl command to query a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53619#M13032</link>
      <description>&lt;P&gt;First of all, it looks like you have an placeholder for a variable called &lt;CODE&gt;earliest&lt;/CODE&gt; in your saved search. Probably you don't want that. But if you do want that, then you need to pass it as arguments to the &lt;CODE&gt;| savedsearch&lt;/CODE&gt; command, within the search string, e.g., &lt;CODE&gt;| savedsearch earliest=-24h@h&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;But if you really don't want that, take it out of the saved search and just pass it as normal HTTP parameter in curl:&lt;/P&gt;

&lt;P&gt;... -d earliest_time=-24h@h ...&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2013 23:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53619#M13032</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-03-06T23:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass the earliest ,latest time and span as arguments to the curl command to query a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53620#M13033</link>
      <description>&lt;P&gt;Thanks mate&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 20:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-the-earliest-latest-time-and-span-as-arguments-to/m-p/53620#M13033</guid>
      <dc:creator>bubby248</dc:creator>
      <dc:date>2013-03-13T20:02:09Z</dc:date>
    </item>
  </channel>
</rss>

