<?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: Rest API - Returning 401 Unauthorized in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335237#M159816</link>
    <description>&lt;P&gt;ok so maybe in iptables you route port 8090 to 8089?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Mar 2018 17:59:01 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2018-03-07T17:59:01Z</dc:date>
    <item>
      <title>Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335221#M159800</link>
      <description>&lt;P&gt;I'm getting a &lt;STRONG&gt;401 Unauthorized&lt;/STRONG&gt; error no matter what I try, when trying to access the REST API. I've tried with curl and via regular web browser, same error. I tried using the admin account, I tried creating a new account and a new role which has the following REST capabilities:&lt;BR /&gt;
rest_apps_management&lt;BR /&gt;
rest_apps_view&lt;BR /&gt;
rest_properties_get&lt;BR /&gt;
rest_properties_set&lt;/P&gt;

&lt;P&gt;This new account's username and password is standard, no special characters.&lt;/P&gt;

&lt;P&gt;curl -u restapi:password  -k &lt;A href="https://testserver:8089/services/search/jobs" target="_blank"&gt;https://testserver:8089/services/search/jobs&lt;/A&gt; -d search="search *"&lt;/P&gt;

&lt;P&gt;But I've also tried assigning the admin role and all the other capabilities. Nothing works. I get this error everytime. Is there something else that I need to set in Splunk? This is driving me bananas at this stage. We have a fully licencse on-side Splunk instance, but I am using the unlicensed latest version in a test environment.&lt;/P&gt;

&lt;P&gt;Thanks for any help&lt;BR /&gt;
Sean&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:05:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335221#M159800</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2020-09-29T15:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335222#M159801</link>
      <description>&lt;P&gt;They also need the rest "tok" capabilities AND you must change the default admin password from changeme to something else.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 18:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335222#M159801</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-07-27T18:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335223#M159802</link>
      <description>&lt;P&gt;Thanks jkcat. The only capability that I could find with the word "tok" in it was "request_remote_tok", and enabling that didn't make a difference. Am I missing something? Also I changed the password from default, that didn't make a difference, either. Still getting the same 401 Unauthorized error&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335223#M159802</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2020-09-29T15:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335224#M159803</link>
      <description>&lt;P&gt;Is there a proxy server configured on your host you're testing from?&lt;/P&gt;

&lt;P&gt;Are you using splunk free or splunk lite?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 15:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335224#M159803</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-02T15:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335225#M159804</link>
      <description>&lt;P&gt;Not sure why, but the solution to this problem was to change the port to 8090!!&lt;/P&gt;

&lt;P&gt;curl -u restapi:password -k &lt;A href="https://testserver:8090/services/search/jobs"&gt;https://testserver:8090/services/search/jobs&lt;/A&gt; -d search="search *"&lt;/P&gt;

&lt;P&gt;Why would this be?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 18:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335225#M159804</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-14T18:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335226#M159805</link>
      <description>&lt;P&gt;I guess you've changed the SplunkD port  somehow.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:37:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335226#M159805</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-14T19:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335227#M159806</link>
      <description>&lt;P&gt;I don't believe I did. I had no reason to at all.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 22:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335227#M159806</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-14T22:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335228#M159807</link>
      <description>&lt;P&gt;Can you post the output of this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;netstat -an | grep 808
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Aug 2017 23:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335228#M159807</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-14T23:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335229#M159808</link>
      <description>&lt;P&gt;Also this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ps -ef | grep 808
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Aug 2017 23:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335229#M159808</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-14T23:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335230#M159809</link>
      <description>&lt;P&gt;I have it installed on Windows Server 2012. What would the command be on that? The guy who found the solution to change the port in the command might have also changed the port in the server settings, so I'm asking and will let you know. Either way, there was still a problem with 8089&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335230#M159809</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-15T15:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335231#M159810</link>
      <description>&lt;P&gt;It was just the port in the command that was changed to 8090 - nothing on the server was changed&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335231#M159810</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-15T15:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335232#M159811</link>
      <description>&lt;P&gt;netstat -an | findstr :808&lt;/P&gt;

&lt;P&gt;Please&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 21:57:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335232#M159811</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-15T21:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335233#M159812</link>
      <description>&lt;P&gt;Please provide the output of this ran from a command prompt:&lt;/P&gt;

&lt;P&gt;netstat -an | findstr :808&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2017 21:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335233#M159812</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-15T21:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335234#M159813</link>
      <description>&lt;P&gt;netstat -an | findstr :808&lt;BR /&gt;
  TCP    0.0.0.0:8088           0.0.0.0:0              LISTENING&lt;BR /&gt;
  TCP    0.0.0.0:8089           0.0.0.0:0              LISTENING&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 11:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335234#M159813</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-16T11:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335235#M159814</link>
      <description>&lt;P&gt;This shows something is already listening on port 8089 so Splunk probably asked on startup if you'd like to use another port and chose the next available 8090.&lt;/P&gt;

&lt;P&gt;Do you have a Splunk universal forwarder installed too?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 22:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335235#M159814</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-17T22:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335236#M159815</link>
      <description>&lt;P&gt;Nope, no universal forwarder in this dev environment - the fact that it is working now is that main thing, but thanks for all your help!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 13:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335236#M159815</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-18T13:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335237#M159816</link>
      <description>&lt;P&gt;ok so maybe in iptables you route port 8090 to 8089?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 17:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/335237#M159816</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-03-07T17:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rest API - Returning 401 Unauthorized</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/622159#M216264</link>
      <description>&lt;P&gt;Hi Team&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am getting the below error while trying to access&amp;nbsp; splunk Rest API . . I am trying to login using the username and password.&amp;nbsp; Is there any other access required to successfully Login .Please help on the same.&lt;/P&gt;&lt;P&gt;Below is the code snippet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Map&amp;lt;String,Object&amp;gt; connectionArgs=new HashMap&amp;lt;String,Object&amp;gt;();&lt;BR /&gt;connectionArgs.put("host", "myHost");&lt;/P&gt;&lt;P&gt;connectionArgs.put("username", "myUsename");&lt;BR /&gt;connectionArgs.put("password", "myPassword");&lt;BR /&gt;connectionArgs.put("port",8089);&lt;BR /&gt;connectionArgs.put("scheme","https");&lt;BR /&gt;&lt;BR /&gt;HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);&lt;/P&gt;&lt;P&gt;Service service=Service.connect(connectionArgs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception in thread "main" com.splunk.HttpException: HTTP 401 -- Login failed&lt;BR /&gt;at com.splunk.HttpException.create(HttpException.java:84)&lt;BR /&gt;at com.splunk.HttpService.send(HttpService.java:452)&lt;BR /&gt;at com.splunk.Service.send(Service.java:1293)&lt;BR /&gt;at com.splunk.HttpService.post(HttpService.java:308)&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 13:45:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-API-Returning-401-Unauthorized/m-p/622159#M216264</guid>
      <dc:creator>Subarna</dc:creator>
      <dc:date>2022-11-26T13:45:16Z</dc:date>
    </item>
  </channel>
</rss>

