<?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 does REST API access work via a web browser, but not via CURL? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423215#M74338</link>
    <description>&lt;P&gt;Sadly, the issue was that the CLI way of adding a user really messes up on a LOT of special characters. I had to reset my password without them.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jun 2018 22:07:31 GMT</pubDate>
    <dc:creator>thisissplunk</dc:creator>
    <dc:date>2018-06-07T22:07:31Z</dc:date>
    <item>
      <title>Why does REST API access work via a web browser, but not via CURL?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423210#M74333</link>
      <description>&lt;P&gt;I'm accessing my forwarder's REST API endpoints like so in a web browser and it works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://10.10.10.10:8089/services/configs/inputs" target="test_blank"&gt;https://10.10.10.10:8089/services/configs/inputs&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I try to do the same via curl:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u 'my.splunk.username' &lt;A href="https://10.10.10.10:8089/services/configs/inputs" target="test_blank"&gt;https://10.10.10.10:8089/services/configs/inputs&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get "Unauthorized" instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Enter host password for user 'my.splunk.username':
&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="ERROR"&amp;gt;Unauthorized&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there something else I need to enable on my forwarder to allow these calls?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 00:00:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423210#M74333</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2018-05-30T00:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why does REST API access work via a web browser, but not via CURL?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423211#M74334</link>
      <description>&lt;P&gt;are you connecting from the same remote machine in both examples, or is one (the browser) local on the server that has the forwarder and curl is done remotely? Also, are you doing both calls with &lt;CODE&gt;'my.splunk.username'&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 00:04:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423211#M74334</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-05-30T00:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why does REST API access work via a web browser, but not via CURL?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423212#M74335</link>
      <description>&lt;P&gt;I'm connecting from the same machine (my laptop) and using the same credentials. My account has the admin role. Do I need to give it more roles possibly?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 17:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423212#M74335</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2018-05-30T17:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why does REST API access work via a web browser, but not via CURL?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423213#M74336</link>
      <description>&lt;P&gt;Are you providing both user name and password in the curl command, the same user name ans password that you'll use in browser?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u username:password &lt;A href="https://10.10.10.10:8089/services/configs/inputs" target="test_blank"&gt;https://10.10.10.10:8089/services/configs/inputs&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 May 2018 21:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423213#M74336</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-30T21:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why does REST API access work via a web browser, but not via CURL?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423214#M74337</link>
      <description>&lt;P&gt;if you providing -u argument you need to provide authentication 'username:password'&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -u 'username:password' &lt;A href="https://10.10.10.10:8089/services/configs/inputs" target="test_blank"&gt;https://10.10.10.10:8089/services/configs/inputs&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;One more thing, I see here is the network IP you are using, it could be sitting inside same private network but in different VPC. &lt;BR /&gt;
Try adding the hostname to no_proxy variable and then do a CURL, adding the host will allow the request not enter through Internet Gateway but will treat the other host VPC in same private network.&lt;/P&gt;

&lt;P&gt;Add your host to no_proxy env variable&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;bash$ env | grep no_proxy
bash$ export no_proxy=$no_proxy,10.10.10.10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;bash$ curl -k -u 'username:password' 'https://10.10.10.10:8089/services/configs/inputs'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;bash$ curl &lt;A href="https://10.10.10.10:8089/services/configs/inputs" target="test_blank"&gt;https://10.10.10.10:8089/services/configs/inputs&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 00:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423214#M74337</guid>
      <dc:creator>sunilpanda023</dc:creator>
      <dc:date>2018-05-31T00:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why does REST API access work via a web browser, but not via CURL?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423215#M74338</link>
      <description>&lt;P&gt;Sadly, the issue was that the CLI way of adding a user really messes up on a LOT of special characters. I had to reset my password without them.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 22:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-REST-API-access-work-via-a-web-browser-but-not-via-CURL/m-p/423215#M74338</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2018-06-07T22:07:31Z</dc:date>
    </item>
  </channel>
</rss>

