<?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 span from REST API call in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Pass-span-from-REST-API-call/m-p/75687#M1053</link>
    <description>&lt;P&gt;Great question - I had to go ask someone &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The answer is that yes, you can. If you create saved search called "Foo" with a query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | timechart span=$span$ count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then execute it by executing a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| savedsearch Foo span=1d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So from the REST API perspective, you would make a POST request to the &lt;CODE&gt;search/jobs&lt;/CODE&gt; endpoint with the &lt;CODE&gt;search&lt;/CODE&gt; parameter set to the above query.&lt;/P&gt;

&lt;P&gt;Hopefully that makes sense - let me know if you need nay more clarification.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2012 03:51:17 GMT</pubDate>
    <dc:creator>ineeman</dc:creator>
    <dc:date>2012-07-12T03:51:17Z</dc:date>
    <item>
      <title>How to Pass span from REST API call</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Pass-span-from-REST-API-call/m-p/75686#M1052</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;

&lt;P&gt;I am getting data to our monitoring dashboards from splunk. The dashboards display data for 2hr, 24hrs, 7 days. So I am able to provide earliest and latest time from rest api to the saved search. but also i have to change timechart span based on timeperiod(2hr:-span=5min ,  24hrs:- span=1hr 7days:-span=1day). is there any away i can also pass span parameter to the saved search. so that i can minimize my saved searches from 20 to 5.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Pass-span-from-REST-API-call/m-p/75686#M1052</guid>
      <dc:creator>splunkingsplunk</dc:creator>
      <dc:date>2012-06-14T16:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Pass span from REST API call</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Pass-span-from-REST-API-call/m-p/75687#M1053</link>
      <description>&lt;P&gt;Great question - I had to go ask someone &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The answer is that yes, you can. If you create saved search called "Foo" with a query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | timechart span=$span$ count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then execute it by executing a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| savedsearch Foo span=1d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So from the REST API perspective, you would make a POST request to the &lt;CODE&gt;search/jobs&lt;/CODE&gt; endpoint with the &lt;CODE&gt;search&lt;/CODE&gt; parameter set to the above query.&lt;/P&gt;

&lt;P&gt;Hopefully that makes sense - let me know if you need nay more clarification.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2012 03:51:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Pass-span-from-REST-API-call/m-p/75687#M1053</guid>
      <dc:creator>ineeman</dc:creator>
      <dc:date>2012-07-12T03:51:17Z</dc:date>
    </item>
  </channel>
</rss>

