<?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: Run makeresults command through REST API is giving error in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649578#M224595</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230985"&gt;@denissotoacc&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share your sample code?&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 06:54:30 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2023-07-07T06:54:30Z</dc:date>
    <item>
      <title>Run makeresults command through REST API is giving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649575#M224593</link>
      <description>&lt;P&gt;I receive the following error while trying to execute a simple "makeresults" command by using REST API call:&lt;BR /&gt;&lt;BR /&gt;Used endpoint:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/myapp/search/jobs" target="_blank"&gt;https://localhost:8089/servicesNS/nobody/myapp/search/jobs&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Search example:&lt;/P&gt;&lt;P&gt;"| makeresults | eval name=\"denis\""&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error message:&lt;BR /&gt;"Error in 'makeresults' command: This command must be the first command of a search."&lt;/P&gt;&lt;P&gt;"search": "search | makeresults | eval nombre=\"denis\""&lt;BR /&gt;&lt;BR /&gt;I see that the API call changes my search adding a "search" word before the search itself. How can I get riddle of that?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 06:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649575#M224593</guid>
      <dc:creator>denissotoacc</dc:creator>
      <dc:date>2023-07-07T06:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Run makeresults command through REST API is giving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649578#M224595</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230985"&gt;@denissotoacc&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share your sample code?&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 06:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649578#M224595</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-07-07T06:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Run makeresults command through REST API is giving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649609#M224604</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This should work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[soutamo@vega] ~&amp;gt;
(0) $ curl -ku $PASS https://localhost:8089/servicesNS/-/search/search/jobs -d search=" |makeresults|eval name=\"denis\""
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;sid&amp;gt;1688721961.24&amp;lt;/sid&amp;gt;
&amp;lt;/response&amp;gt;
[soutamo@vega] ~&amp;gt;
(0) $ export SID=1688721961.24 &amp;amp;&amp;amp;  curl -sku $PASS https://localhost:8089/services/search/jobs/$SID/results?output_mode=json|jq '.results'
[
  {
    "_time": "2023-07-07T12:26:02.000+03:00",
    "name": "denis"
  }
]
[soutamo@vega] ~&amp;gt;
(0) $&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 09:28:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/649609#M224604</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-07-07T09:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Run makeresults command through REST API is giving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/692614#M235730</link>
      <description>&lt;P&gt;Try using this uri:&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://community.splunk.com/" target="_blank"&gt;https://&amp;lt;host&amp;gt;:&amp;lt;mPort&amp;gt;/services/search/v2/jobs/&lt;/A&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;The api uri that you are using is depricated.&lt;BR /&gt;To my knowledge, it &lt;STRONG&gt;deletes the "|" in the beginning of the SPL query&lt;/STRONG&gt;, that's why you got the error&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;"Error in 'makeresults' command: This command must be the first command of a search.".&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;What splunk receives from your &lt;STRONG&gt;query "search | makeresults | eval nombre=\"denis\""&lt;/STRONG&gt; with api call is this:&lt;BR /&gt;makeresults | eval nombre="denis"&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;AND NOT&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;|&lt;/FONT&gt;&lt;/STRONG&gt; makeresults | eval nombre="denis"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.2/RESTREF/RESTsearch#search.2Fv2.2Fjobs.2F.7Bsearch_id.7D.2Fresults" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.2/RESTREF/RESTsearch#search.2Fv2.2Fjobs.2F.7Bsearch_id.7D.2Fresults&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 09:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Run-makeresults-command-through-REST-API-is-giving-error/m-p/692614#M235730</guid>
      <dc:creator>Nadhem9</dc:creator>
      <dc:date>2024-07-08T09:41:48Z</dc:date>
    </item>
  </channel>
</rss>

