<?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 Get current logged in user's Email Address in Javascript SDK in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301642#M19250</link>
    <description>&lt;P&gt;I'm attempting to get the current logged in user's email address from the Javascript SDK to pass to a js variable. I can get the current logged in Username, however the &lt;EM&gt;configKey&lt;/EM&gt; values don't seem to exist in this docs article for getConfigValue, so I'm not sure what value to use for email address&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.6.5/ModuleRef/Splunk.util#Parameters_8"&gt;https://docs.splunk.com/Documentation/Splunk/6.6.5/ModuleRef/Splunk.util#Parameters_8&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Does anybody have the &lt;EM&gt;configKey&lt;/EM&gt; value for the email address for the user in the JavaScript SDK? Or even an explanation for all of the options for &lt;EM&gt;configKey&lt;/EM&gt; under getConfigValue? &lt;/P&gt;

&lt;P&gt;Here's the code I'm trying: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(["underscore","jquery","splunkjs/mvc","splunkjs/mvc/utils","splunkjs/mvc/simplexml/ready!"],
            function(_,$,mvc,utils) {
                    var username =  Splunk.util.getConfigValue("USERNAME").toLowerCase() 
                    var email = Splunk.util.getConfigValue("email")
            });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Jan 2018 01:09:37 GMT</pubDate>
    <dc:creator>cboulware</dc:creator>
    <dc:date>2018-01-11T01:09:37Z</dc:date>
    <item>
      <title>Get current logged in user's Email Address in Javascript SDK</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301642#M19250</link>
      <description>&lt;P&gt;I'm attempting to get the current logged in user's email address from the Javascript SDK to pass to a js variable. I can get the current logged in Username, however the &lt;EM&gt;configKey&lt;/EM&gt; values don't seem to exist in this docs article for getConfigValue, so I'm not sure what value to use for email address&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.6.5/ModuleRef/Splunk.util#Parameters_8"&gt;https://docs.splunk.com/Documentation/Splunk/6.6.5/ModuleRef/Splunk.util#Parameters_8&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Does anybody have the &lt;EM&gt;configKey&lt;/EM&gt; value for the email address for the user in the JavaScript SDK? Or even an explanation for all of the options for &lt;EM&gt;configKey&lt;/EM&gt; under getConfigValue? &lt;/P&gt;

&lt;P&gt;Here's the code I'm trying: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(["underscore","jquery","splunkjs/mvc","splunkjs/mvc/utils","splunkjs/mvc/simplexml/ready!"],
            function(_,$,mvc,utils) {
                    var username =  Splunk.util.getConfigValue("USERNAME").toLowerCase() 
                    var email = Splunk.util.getConfigValue("email")
            });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 01:09:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301642#M19250</guid>
      <dc:creator>cboulware</dc:creator>
      <dc:date>2018-01-11T01:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get current logged in user's Email Address in Javascript SDK</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301643#M19251</link>
      <description>&lt;P&gt;@cboulware, first off Advanced XML is deprecated.&lt;/P&gt;

&lt;P&gt;Secondly, the default environment tokens are available in Splunk ( Splunk Enterprise 6.5 and above ) which capture details like current User Name current App Name and event current user email. You do not need JavaScript as the same will be available directly in Simple XML &lt;CODE&gt;$env:user_email$&lt;/CODE&gt;. You can also check out the &lt;A href="https://splunkbase.splunk.com/app/1603/"&gt;Splunk Dashboard Examples App&lt;/A&gt; which has &lt;CODE&gt;Default Environment Tokens&lt;/CODE&gt; example to showcase the same.&lt;/P&gt;

&lt;P&gt;Refer to documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Use_global_tokens_to_access_environment_information"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Use_global_tokens_to_access_environment_information&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 06:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301643#M19251</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-01-11T06:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get current logged in user's Email Address in Javascript SDK</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301644#M19252</link>
      <description>&lt;P&gt;Yes, I'm aware that Advanced XML is depreciated, and I'm also aware of the global environmental tokens. However in this script I'm dispatching a oneshot search using the Javascript SDK, and I need to have the current user's email address. &lt;/P&gt;

&lt;P&gt;I guess I can enable tokenization in my search and pass a global token, I was just wondering if there was some documentation on parts of the Javascript SDK that don't seem to be there, mainly what values you can use for &lt;EM&gt;configKey&lt;/EM&gt; in the above linked doc article. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 15:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301644#M19252</guid>
      <dc:creator>cboulware</dc:creator>
      <dc:date>2018-01-11T15:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Get current logged in user's Email Address in Javascript SDK</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301645#M19253</link>
      <description>&lt;P&gt;@cboulware, since your question is not answered, I have converted my answer to comment. So that this flags as unanswered meanwhile I try to find the details you are looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301645#M19253</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-01-12T16:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get current logged in user's Email Address in Javascript SDK</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301646#M19254</link>
      <description>&lt;P&gt;Please try this..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(["underscore","jquery","splunkjs/mvc","splunkjs/mvc/simplexml/ready!"],
    function(_,$,mvc) {
        myService = splunkjs.mvc.createService();
        myService.currentUser().then(function(){
            alert(JSON.parse(arguments[0]).entry[0].content.email);
        });        
 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2018 10:34:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Get-current-logged-in-user-s-Email-Address-in-Javascript-SDK/m-p/301646#M19254</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2018-01-16T10:34:13Z</dc:date>
    </item>
  </channel>
</rss>

