<?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: Why am I getting &amp;quot;Unknown search command ...&amp;quot; when trying to run a macro form the Java SDK? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170089#M48675</link>
    <description>&lt;P&gt;You may need to prepend the &lt;CODE&gt;search&lt;/CODE&gt; command to your search job. In the web interface this is done implicitly.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2015 16:40:43 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-03-06T16:40:43Z</dc:date>
    <item>
      <title>Why am I getting "Unknown search command ..." when trying to run a macro form the Java SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170088#M48674</link>
      <description>&lt;P&gt;We have a macro set up under 'Advanced search » Search macros', it takes 3 parameters (host, neighborIP, days). To run it from the search box in Splunk I simply put `my_macro(*,*,31)` which works fine. When I try to run this using the Java SDK I get the message "Unknown search command 'host'."&lt;BR /&gt;
Below is the relevant part of the code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
jobArgs.setExecutionMode(JobArgs.ExecutionMode.NORMAL);
JobCollection jobs = service.getJobs();
Job job = jobs.create("`my_macro(*,*,31)`", jobArgs);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Needless to say I'm new to Splunk and I may be being a bit dumb but, I can't seem to find information about executing macros with parameters from the SDK in the splunk documentation.&lt;/P&gt;

&lt;P&gt;Any help would be very much appreciated&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 14:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170088#M48674</guid>
      <dc:creator>lattar</dc:creator>
      <dc:date>2015-03-06T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "Unknown search command ..." when trying to run a macro form the Java SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170089#M48675</link>
      <description>&lt;P&gt;You may need to prepend the &lt;CODE&gt;search&lt;/CODE&gt; command to your search job. In the web interface this is done implicitly.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 16:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170089#M48675</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-03-06T16:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "Unknown search command ..." when trying to run a macro form the Java SDK?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170090#M48676</link>
      <description>&lt;P&gt;Thanks very much.&lt;/P&gt;

&lt;P&gt;For anyone else with the same issue I changed the command to :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Job job = jobs.create("search `my_macro(*,*,31)`", jobArgs);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2015 09:25:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Unknown-search-command-quot-when-trying-to/m-p/170090#M48676</guid>
      <dc:creator>lattar</dc:creator>
      <dc:date>2015-03-09T09:25:33Z</dc:date>
    </item>
  </channel>
</rss>

