<?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: &amp;quot;ERROR&amp;quot;  Search Factory: Unknown search command '1'. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336559#M164429</link>
    <description>&lt;P&gt;Remember that the UI will append the inferred &lt;CODE&gt;search&lt;/CODE&gt; command, but the API will not.  This means that a search string passed to the API needs to either start with the &lt;CODE&gt;search&lt;/CODE&gt; command or &lt;CODE&gt;|&lt;/CODE&gt; to use a generating command.&lt;/P&gt;

&lt;P&gt;See the &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/RESTTUT/RESTsearches"&gt;Python Example&lt;/A&gt; for sample code that handles this.&lt;/P&gt;

&lt;P&gt;If you believe this isn't the issue please paste the search query you are passing to the API for further comment.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2017 23:39:36 GMT</pubDate>
    <dc:creator>micahkemp</dc:creator>
    <dc:date>2017-12-11T23:39:36Z</dc:date>
    <item>
      <title>"ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336558#M164428</link>
      <description>&lt;P&gt;when I ran a script to access Splunk API , and got this error:&lt;BR /&gt;
Search Factory: Unknown search command '1'.&lt;/P&gt;

&lt;P&gt;could you please help on this?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 21:20:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336558#M164428</guid>
      <dc:creator>jenniferhao</dc:creator>
      <dc:date>2017-12-11T21:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336559#M164429</link>
      <description>&lt;P&gt;Remember that the UI will append the inferred &lt;CODE&gt;search&lt;/CODE&gt; command, but the API will not.  This means that a search string passed to the API needs to either start with the &lt;CODE&gt;search&lt;/CODE&gt; command or &lt;CODE&gt;|&lt;/CODE&gt; to use a generating command.&lt;/P&gt;

&lt;P&gt;See the &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/RESTTUT/RESTsearches"&gt;Python Example&lt;/A&gt; for sample code that handles this.&lt;/P&gt;

&lt;P&gt;If you believe this isn't the issue please paste the search query you are passing to the API for further comment.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 23:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336559#M164429</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-11T23:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336560#M164430</link>
      <description>&lt;P&gt;my query likes "search='search index=xxxxx.....'".  Do you have any document that mentioned SPLUNK API NOT supporting special characters?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 17:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336560#M164430</guid>
      <dc:creator>jenniferhao</dc:creator>
      <dc:date>2017-12-12T17:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336561#M164431</link>
      <description>&lt;P&gt;it sounds the API is not supporting "fillnull value=NULL". I debug line be line and stuck on this line. Any solution?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 17:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336561#M164431</guid>
      <dc:creator>jenniferhao</dc:creator>
      <dc:date>2017-12-12T17:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336562#M164432</link>
      <description>&lt;P&gt;Hi jennifer, it would be helpful if you could share the sample of the code you use to post the search.&lt;/P&gt;

&lt;P&gt;If you are building the POST data yourself, there should not be quotes inside your search parameter, for example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search=search+index%3D_internal&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;(The equal is url encoded)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 17:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336562#M164432</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2017-12-12T17:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336563#M164433</link>
      <description>&lt;P&gt;After I removed the fillnull then the query works with API. Do you know the API support fillnull or not?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 17:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336563#M164433</guid>
      <dc:creator>jenniferhao</dc:creator>
      <dc:date>2017-12-12T17:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336564#M164434</link>
      <description>&lt;P&gt;There is no reason for the API not to support the &lt;CODE&gt;fillnull&lt;/CODE&gt; command.&lt;BR /&gt;
I managed to get it working using the following as an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search=search+index%3D_internal+component%3D%2A+%7C+stats+sum%28cpu_seconds%29+by+component+%7C+fillnull+value%3DNULL
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please share you full query for further debugging, you can mask anything sensitive if needed.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336564#M164434</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2017-12-13T09:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336565#M164435</link>
      <description>&lt;P&gt;here is my query:&lt;BR /&gt;
myquery='search index=anyindex sourcetype=anysourcetype earliest=-7d |fields * | fillnull'&lt;/P&gt;

&lt;H2&gt;mystr="curl -k -u username:password &lt;A href="https://splkurl//services/search/jobs/export"&gt;https://splkurl//services/search/jobs/export&lt;/A&gt; --data-urlencode search=${myquery} -d output_mode=csv -o res.csv"&lt;/H2&gt;

&lt;P&gt;If successfully got the data, then I can cat res.csv; otherwise the file will be not generated. ,my scripts likes:&lt;/P&gt;

&lt;H2&gt;Please use the following script.&lt;/H2&gt;

&lt;H1&gt;!/bin/bash&lt;/H1&gt;

&lt;P&gt;myquery='search index=anyindex sourcetype=anysourcetype earliest=-7d |fields * | fillnull'&lt;/P&gt;

&lt;P&gt;mystr="curl -k -u username:password &lt;A href="https://splkurl//services/search/jobs/export"&gt;https://splkurl//services/search/jobs/export&lt;/A&gt; --data-urlencode search=${myquery} -d output_mode=csv -o res.csv"&lt;/P&gt;

&lt;HR /&gt;</description>
      <pubDate>Wed, 13 Dec 2017 19:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336565#M164435</guid>
      <dc:creator>jenniferhao</dc:creator>
      <dc:date>2017-12-13T19:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: "ERROR"  Search Factory: Unknown search command '1'.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336566#M164436</link>
      <description>&lt;P&gt;Managed to get results using the following script:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash
myquery='search index=_internal component=* earliest=-7d | stats sum(cpu_seconds) by component | fields * | fillnull'

curl -k -u user:pass  &lt;A href="https://localhost:8089/services/search/jobs/export" target="test_blank"&gt;https://localhost:8089/services/search/jobs/export&lt;/A&gt; --data-urlencode "search=${myquery}" -d output_mode=csv -o res.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Dec 2017 23:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-ERROR-quot-Search-Factory-Unknown-search-command-1/m-p/336566#M164436</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2017-12-15T23:32:55Z</dc:date>
    </item>
  </channel>
</rss>

