<?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: REST API call to run a saved search with macro replacement? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/REST-API-call-to-run-a-saved-search-with-macro-replacement/m-p/25927#M282</link>
    <description>&lt;P&gt;No, there is no facility for setting the saved search replacement parameters via the API.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Aug 2010 05:55:09 GMT</pubDate>
    <dc:creator>Stephen_Sorkin</dc:creator>
    <dc:date>2010-08-21T05:55:09Z</dc:date>
    <item>
      <title>REST API call to run a saved search with macro replacement?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/REST-API-call-to-run-a-saved-search-with-macro-replacement/m-p/25926#M281</link>
      <description>&lt;P&gt;Is there a way to directly launch a saved search via the scheduler while passing key/value pairs for macro replacement via an API call?&lt;/P&gt;

&lt;P&gt;The only place I've seen any reference to macro replacements for saved search is with the &lt;CODE&gt;savedsearch&lt;/CODE&gt; search command documentation, and it's fairly brief.  So I haven't seen anything that talks about how to do this, but that's not too surprising.&lt;/P&gt;

&lt;P&gt;Just for the reccord, (because I'm sure someone will point it out)...  Simply running a search of  "&lt;CODE&gt;| savedsearch mysavedsearch key=value&lt;/CODE&gt;" is not an option in my particular use case.  I need any triggered actions associated with the saved search to be run, and the only way I know of doing that is via the scheduler.  So I believe that rules out the possibility of using the &lt;CODE&gt;savedsearch&lt;/CODE&gt; search command.&lt;/P&gt;

&lt;P&gt;My ultimate goal is to do this from Splunk's python API.  I can launch a saved search with the scheduler like so, the only piece I'm missing is how to pass in values for macro expansion.  Any ideas?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import splunk.saved
job = splunk.saved.dispatchSavedSearch("mysavedsearch", sessionKey=sessionKey, namespace="myapp", owner="owner", triggerActions="1", now=timestamp)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Related stuff:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://answers.splunk.com/questions/3077/what-is-macro-replacement-in-a-saved-search" rel="nofollow"&gt;What is macro replacement in a saved search?&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 06 Aug 2010 04:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/REST-API-call-to-run-a-saved-search-with-macro-replacement/m-p/25926#M281</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-06T04:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: REST API call to run a saved search with macro replacement?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/REST-API-call-to-run-a-saved-search-with-macro-replacement/m-p/25927#M282</link>
      <description>&lt;P&gt;No, there is no facility for setting the saved search replacement parameters via the API.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2010 05:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/REST-API-call-to-run-a-saved-search-with-macro-replacement/m-p/25927#M282</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-21T05:55:09Z</dc:date>
    </item>
  </channel>
</rss>

