<?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: Examples of using variable in REST API search?  Is it possible? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76315#M15577</link>
    <description>&lt;P&gt;For example, I want to create a search that accepts a variable input (e.g. IP address) so I can reuse it.  After thinking more about this, looks like I can pre-populate Splunk with saved searches that accept such a variable but it would be nice to see cool examples of how other customers have done this.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2013 18:06:47 GMT</pubDate>
    <dc:creator>the_wolverine</dc:creator>
    <dc:date>2013-01-03T18:06:47Z</dc:date>
    <item>
      <title>Examples of using variable in REST API search?  Is it possible?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76313#M15575</link>
      <description>&lt;P&gt;Are there any examples of how to pass a variable to query when using REST API?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 01:00:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76313#M15575</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2013-01-03T01:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Examples of using variable in REST API search?  Is it possible?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76314#M15576</link>
      <description>&lt;P&gt;Can you expand upon your use case? I'm not clear on what you mean by a variable.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 10:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76314#M15576</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2013-01-03T10:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Examples of using variable in REST API search?  Is it possible?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76315#M15577</link>
      <description>&lt;P&gt;For example, I want to create a search that accepts a variable input (e.g. IP address) so I can reuse it.  After thinking more about this, looks like I can pre-populate Splunk with saved searches that accept such a variable but it would be nice to see cool examples of how other customers have done this.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 18:06:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76315#M15577</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2013-01-03T18:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Examples of using variable in REST API search?  Is it possible?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76316#M15578</link>
      <description>&lt;P&gt;Here's an example of running a saved search and passing a variable to it.  In this case, the variable is host field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$curl -k -u admin:password &lt;A href="https://splunkserver:8089/services/search/jobs/export" target="test_blank"&gt;https://splunkserver:8089/services/search/jobs/export&lt;/A&gt; -d search="savedsearch \ MySavedSearch%20host%3Dwolverine*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(use "MySavedSearch" and input variable host=wolverine* )&lt;/P&gt;

&lt;P&gt;I have a saved search named "MySavedSearch" the query of the search contains:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"index=main $host$ | head 100"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I wish there were more examples like this in the documentation so I am providing it here in hopes that it can help someone else.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2013 22:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Examples-of-using-variable-in-REST-API-search-Is-it-possible/m-p/76316#M15578</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2013-01-07T22:50:09Z</dc:date>
    </item>
  </channel>
</rss>

