<?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 unable to run savedsearches from RESTAPI? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360676#M65785</link>
    <description>&lt;P&gt;Strange, the saved search should have been replicated across the cluster - unless your created it by editing manually &lt;CODE&gt;savedsearches.conf&lt;/CODE&gt; on one of the search head?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 16:25:18 GMT</pubDate>
    <dc:creator>damien_chillet</dc:creator>
    <dc:date>2018-04-26T16:25:18Z</dc:date>
    <item>
      <title>Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360669#M65778</link>
      <description>&lt;P&gt;All, I created simple savedsearch as followed:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | makeresults | eval msg="test for Jason"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And save it as "ggarcia_test_jason"&lt;/P&gt;

&lt;P&gt;But when I try to run it from command line using RESTAPI I am getting the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ggarcia-osx:~ ggarcia$ curl -ks -u 'ggarcia:********' "https://splunk.ssnsgs.net:8089/servicesNS/admin/search/search/jobs/export" -d search=" savedsearch ggarcia_test_jason"
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="FATAL"&amp;gt;Error in 'savedsearch' command: Unable to find saved search named 'ggarcia_test_jason'.&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can run the search directly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ggarcia-osx:~ ggarcia$ curl -ks -u 'ggarcia:********' "https://splunk.ssnsgs.net:8089/servicesNS/admin/search/search/jobs/export" -d search=" | makeresults | eval msg=\"test for Jason\"" -d output_mode=json
{"preview":false,"offset":0,"lastrow":true,"result":{"_time":"2018-04-24 16:21:39.000 GMT","msg":"test for Jason"}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have no idea what I am doing wrong.&lt;/P&gt;

&lt;P&gt;Can anybody help me?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:14:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360669#M65778</guid>
      <dc:creator>GersonGarcia</dc:creator>
      <dc:date>2020-09-29T19:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360670#M65779</link>
      <description>&lt;P&gt;could you please share the splunk query that you tried in RestAPI?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 16:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360670#M65779</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-04-24T16:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360671#M65780</link>
      <description>&lt;P&gt;You specified search app context in your API endpoint, are you sure the search is visible in that context?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 09:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360671#M65780</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-25T09:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360672#M65781</link>
      <description>&lt;P&gt;Damien,&lt;/P&gt;

&lt;P&gt;That is a good question... I tried to list all Saved Searches and the one I am trying is not there:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ggarcia-osx:~ ggarcia$ curl -ks -u 'ggarcia:*******' "https://splunk.ssnsgs.net:8089/servicesNS/-/-/saved/searches" | grep '&amp;lt;title&amp;gt;'
  &amp;lt;title&amp;gt;savedsearch&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Bucket Copy Trigger&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Abnormal State of Indexer Processor&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Critical System Physical Memory Usage&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Expired and Soon To Expire Licenses&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Missing forwarders&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Near Critical Disk Usage&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Saturated Event-Processing Queues&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Search Peer Not Responding&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Alert - Total License Usage Near Daily Quota&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Asset - Build Full&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Asset - Build Standalone Asset Table&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Asset - Build Standalone Computed Groups Only&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC Forwarder - Build Asset Table&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;DMC License Usage Data Cube&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Errors in the last 24 hours&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Errors in the last hour&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Indexing workload&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;instrumentation.lastSent&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;instrumentation.licenseUsage&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;instrumentation.reportingErrors&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;License Usage Data Cube&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Messages by minute last 3 hours&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Orphaned scheduled searches&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Splunk errors last 24 hours&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;Top five sourcetypes&amp;lt;/title&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Maybe because it is SH Cluster?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 15:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360672#M65781</guid>
      <dc:creator>GersonGarcia</dc:creator>
      <dc:date>2018-04-26T15:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360673#M65782</link>
      <description>&lt;P&gt;This is interesting...&lt;/P&gt;

&lt;P&gt;If I look for the saved search against my load balance I don't get the result, but if I tried directly to one of the SH it works...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ggarcia-osx:~ ggarcia$ curl -ks -u 'ggarcia:********' "https://s&amp;lt;load_balance&amp;gt;:8089/servicesNS/-/ssn/saved/searches/ggarcia_test_jason" | grep '&amp;lt;title&amp;gt;'
ggarcia-osx:~ ggarcia$ curl -ks -u 'ggarcia:********' "https://&amp;lt;hostname&amp;gt;:8089/servicesNS/-/ssn/saved/searches/ggarcia_test_jason" | grep '&amp;lt;title&amp;gt;'
  &amp;lt;title&amp;gt;savedsearch&amp;lt;/title&amp;gt;
    &amp;lt;title&amp;gt;ggarcia_test_jason&amp;lt;/title&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It worked now... Thank you...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ggarcia-osx:~ ggarcia$ curl -k -u 'ggarcia:*******' "https://&amp;lt;hostname&amp;gt;:8089/servicesNS/admin/ssn/search/jobs/export" -d search=" savedsearch ggarcia_test_jason"
&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;
&amp;lt;results preview='0'&amp;gt;
&amp;lt;meta&amp;gt;
&amp;lt;fieldOrder&amp;gt;
&amp;lt;field&amp;gt;_time&amp;lt;/field&amp;gt;
&amp;lt;field&amp;gt;msg&amp;lt;/field&amp;gt;
&amp;lt;/fieldOrder&amp;gt;
&amp;lt;/meta&amp;gt;
&amp;lt;messages&amp;gt;
  &amp;lt;msg type="DEBUG"&amp;gt;Configuration initialization for /usr/ssn/splunk/etc took 277ms when dispatching a search (search ID: 1524759462.1375367_512742A3-6B36-4E10-8BD6-D073A8FD06D5)&amp;lt;/msg&amp;gt;
  &amp;lt;msg type="DEBUG"&amp;gt;search context: user="ggarcia", app="ssn", bs-pathname="/usr/ssn/splunk/etc"&amp;lt;/msg&amp;gt;
&amp;lt;/messages&amp;gt;

    &amp;lt;result offset='0'&amp;gt;
        &amp;lt;field k='_time'&amp;gt;
            &amp;lt;value&amp;gt;&amp;lt;text&amp;gt;2018-04-26 09:17:42.000 PDT&amp;lt;/text&amp;gt;&amp;lt;/value&amp;gt;
        &amp;lt;/field&amp;gt;
        &amp;lt;field k='msg'&amp;gt;
            &amp;lt;value&amp;gt;&amp;lt;text&amp;gt;test for Jason&amp;lt;/text&amp;gt;&amp;lt;/value&amp;gt;
        &amp;lt;/field&amp;gt;
    &amp;lt;/result&amp;gt;
&amp;lt;/results&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Apr 2018 16:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360673#M65782</guid>
      <dc:creator>GersonGarcia</dc:creator>
      <dc:date>2018-04-26T16:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360674#M65783</link>
      <description>&lt;P&gt;Does the search you are trying to run have private permissions?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 16:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360674#M65783</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-26T16:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360675#M65784</link>
      <description>&lt;P&gt;No, it does not.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 16:21:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360675#M65784</guid>
      <dc:creator>GersonGarcia</dc:creator>
      <dc:date>2018-04-26T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to run savedsearches from RESTAPI?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360676#M65785</link>
      <description>&lt;P&gt;Strange, the saved search should have been replicated across the cluster - unless your created it by editing manually &lt;CODE&gt;savedsearches.conf&lt;/CODE&gt; on one of the search head?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 16:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-unable-to-run-savedsearches-from-RESTAPI/m-p/360676#M65785</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-26T16:25:18Z</dc:date>
    </item>
  </channel>
</rss>

