<?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: Can i use REST API of Splunk itself in Splunk? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243121#M15104</link>
    <description>&lt;P&gt;Thanks .. I found the solution &lt;/P&gt;</description>
    <pubDate>Sun, 27 Sep 2015 18:38:18 GMT</pubDate>
    <dc:creator>kartik13</dc:creator>
    <dc:date>2015-09-27T18:38:18Z</dc:date>
    <item>
      <title>Can i use REST API of Splunk itself in Splunk?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243117#M15100</link>
      <description>&lt;P&gt;I am trying to make a custom dashboard as Splunk dashboard using a third party framework. I am trying to connect to splunk through  REST API ,but during ajax call its giving me &lt;CODE&gt;Request header field Access-Control-All-Headers is not allowed by Access-Control-Allow-Headers.&lt;/CODE&gt; error.My &lt;CODE&gt;server.conf&lt;/CODE&gt; config are as follows&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [sslConfig]
sslKeysfilePassword = $1$0RQz5YVamCN2
enableSplunkdSSL = false
[general]
pass4SymmKey = $1$hlhnucAc03F2
serverName = KARTIKES-WS01

[lmpool:auto_generated_pool_download-trial]
description = auto_generated_pool_download-trial
quota = MAX
slaves = *
stack_id = download-trial

[lmpool:auto_generated_pool_forwarder]
description = auto_generated_pool_forwarder
quota = MAX
slaves = *
stack_id = forwarder

[lmpool:auto_generated_pool_free]
description = auto_generated_pool_free
quota = MAX
slaves = *
stack_id = free

[lmpool:auto_generated_pool_enterprise]
description = auto_generated_pool_enterprise
quota = MAX
slaves = *
stack_id = enterprise

[license]
active_group = Free

[httpServer]
crossOriginSharingPolicy = *
allowBasicAuth = false

[general]
listenOnIPv6 = yes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and my ajax request is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$.ajax({
                url:"http://localhost:9080/services/search/jobs/export",
                type:"POST",
                dataType:"json",

                data:JSON.stringify(somedata),
                headers:{
                "Access-Control-Allow-Origin" : "*",
                "Access-Control-Allow-Methods" : "GET,POST,PUT,DELETE,OPTIONS",
                "Access-Control-Allow-Headers": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"

                },
                crossDomain: true,
             contentType:"application/x-www-form-urlencoded",
                success:function(data){
                    console.log("Data is loaded" + data);
                    },
                error:function(){
                    console.log("Something went Wrong");
                }

      });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So , Can i use REST API in SPlunk itself? Any idea on this?&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 05:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243117#M15100</guid>
      <dc:creator>kartik13</dc:creator>
      <dc:date>2015-09-27T05:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can i use REST API of Splunk itself in Splunk?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243118#M15101</link>
      <description>&lt;P&gt;Yes, you can run REST API commands in the Splunk search UI. Here is an app that shows examples of exactly how to do it:&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/2643/"&gt;REST Endpoint Examples&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Download the app and try it out, then look at the implementation to see how they did it!&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 05:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243118#M15101</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-09-27T05:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can i use REST API of Splunk itself in Splunk?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243119#M15102</link>
      <description>&lt;P&gt;Is the error referring to this?&lt;/P&gt;

&lt;P&gt;"Access-Control-Allow-Headers": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"&lt;/P&gt;

&lt;P&gt;where you're using Access-Control-Allow-Headers in the variable Access-Control-Allow-Headers?&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 11:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243119#M15102</guid>
      <dc:creator>jaredlaney</dc:creator>
      <dc:date>2015-09-27T11:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can i use REST API of Splunk itself in Splunk?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243120#M15103</link>
      <description>&lt;P&gt;yes it was refering to that .I found the solution RESTAPI of Spluk accepts only the Content-Type in headers with following details:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"Content-Type":"application/x-www-form-urlencoded;charset=utf-8"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 18:37:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243120#M15103</guid>
      <dc:creator>kartik13</dc:creator>
      <dc:date>2015-09-27T18:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can i use REST API of Splunk itself in Splunk?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243121#M15104</link>
      <description>&lt;P&gt;Thanks .. I found the solution &lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2015 18:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-i-use-REST-API-of-Splunk-itself-in-Splunk/m-p/243121#M15104</guid>
      <dc:creator>kartik13</dc:creator>
      <dc:date>2015-09-27T18:38:18Z</dc:date>
    </item>
  </channel>
</rss>

