<?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: TA-Webtools curl Authentication in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497004#M61142</link>
    <description>&lt;P&gt;Behind the scenes it's requests lib, a popular web requests library written in python.  It's not actually a curl command. &lt;/P&gt;

&lt;P&gt;User/pass gets base64 encoded and passed in the Authentication Header. &lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 23:53:16 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2019-12-04T23:53:16Z</dc:date>
    <item>
      <title>TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497002#M61140</link>
      <description>&lt;P&gt;Using the Webtools app here - &lt;A href="https://splunkbase.splunk.com/app/4146/#/details"&gt;https://splunkbase.splunk.com/app/4146/#/details&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have a working curl command from the CLI but receiving a 400 response from the Splunk search command… Curious how it works and have a few questions -&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Is there a way to see the CURL command generated by Splunk when the search is executed? Is this logged anywhere? &lt;/LI&gt;
&lt;LI&gt;How do the  “user=username” and “password=password” parameters from the search command compare to “curl -u" option with "user:password"?&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;For example, using curl directly (works) -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-u "user:password" \
-d '{"uuid":"xxxx","inputs":{"Area":"failure","AssignmentGroup":"monitoring platforms","Description0":"SPLUNK Test","Impact":"4","Subarea":"error message","Urgency":"3","AffectedCI":"Test","OriginalText":"SPLUNK Test","Application":"xxx","xx_Node":"xxxxxx","Category":"testing","SourceCI":"xxxx-001","doCreateAlert":"yourdoCreateAlertValue"}}' \
&lt;A href="http://hostname:8080/url/path" target="test_blank"&gt;http://hostname:8080/url/path&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using the curl search command (not working) -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval header="{\"Content-Type\":\"application/json\", \"Accept\":\"application/json\"}" 
| eval data="{\"uuid\":\"xxxx\",\"inputs\":{\"Area\":\"failure\",\"AssignmentGroup\":\"monitoring platforms\",\"Description0\":\"SPLUNK Test\",\"Impact\":\"4\",\"Subarea\":\"error message\",\"Urgency\":\"3\",\"AffectedCI\":\"Test\",\"OriginalText\":\"SPLUNK Test\",\"Application\":\"xxx\",\"xx_Node\":\"xxxxxx\",\"Category\":\"testing\",\"SourceCI\":\"xxxx-001\",\"doCreateAlert\":\"yourdoCreateAlertValue\"}}"
| curl method=post uri=http://hostname:8080/url/path user=user pass=password debug=true datafield=data headerfield=header
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 20:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497002#M61140</guid>
      <dc:creator>ejread</dc:creator>
      <dc:date>2019-12-04T20:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497003#M61141</link>
      <description>&lt;P&gt;Really looks like it should have worked.&lt;/P&gt;

&lt;P&gt;What happens if you add count=1 to your makeresults?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 23:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497003#M61141</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-12-04T23:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497004#M61142</link>
      <description>&lt;P&gt;Behind the scenes it's requests lib, a popular web requests library written in python.  It's not actually a curl command. &lt;/P&gt;

&lt;P&gt;User/pass gets base64 encoded and passed in the Authentication Header. &lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 23:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497004#M61142</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-12-04T23:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497005#M61143</link>
      <description>&lt;P&gt;Unfortunately no difference when adding count=1.&lt;/P&gt;

&lt;P&gt;Also noticed in the search results table, there is a slightly different formatting with a "u". I feel like some formatting in the data payload section may be the problem...&lt;/P&gt;

&lt;P&gt;data field -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"uuid":"xxxx","inputs":
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;curl_data_payload field -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{u'uuid': u'xxxx', u'inputs':
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497005#M61143</guid>
      <dc:creator>ejread</dc:creator>
      <dc:date>2020-09-30T03:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497006#M61144</link>
      <description>&lt;P&gt;That's what a json array looks like when printed to string.  The "u" that is.&lt;/P&gt;

&lt;P&gt;It should be fine like that.  I think maybe the nested json is causing the issue.  Maybe you need to put square brackets around the entire data object to show it's an array...&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 16:06:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497006#M61144</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-12-05T16:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497007#M61145</link>
      <description>&lt;P&gt;I tried square brackets, no luck. Also tried with a non-nested JSON object, and it works through curl but not through the search command (returns a 400). Its seems like a formatting difference in the payload between what is sent with "curl -d" and "datafield=data".  Any way to log what is sent in the POST so it can be compared to curl?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 19:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497007#M61145</guid>
      <dc:creator>ejread</dc:creator>
      <dc:date>2019-12-06T19:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: TA-Webtools curl Authentication</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497008#M61146</link>
      <description>&lt;P&gt;On your search head, you can run tcpdump on whatever port your api is on and see the outbound queries.&lt;/P&gt;

&lt;P&gt;debug=true is supposed to show whats being sent in curl_* fields.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 03:08:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-Webtools-curl-Authentication/m-p/497008#M61146</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-12-07T03:08:40Z</dc:date>
    </item>
  </channel>
</rss>

