<?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 Javascript take splunk username in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Javascript-take-splunk-username/m-p/504431#M4547</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm trying to get the Splunk user that making changes in kv store. I tried to use the rest call but the User_Name fields return "&lt;SPAN&gt;undefined". I launch this search from javascript.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup open_cases

| eval Notes=if(_key=\"" + key + "\",\"" + mod_notes + "\",Notes), Status=\"Work-in-progress\"

| appendcols [ | rest /services/authentication/current-context | rename username AS User_Name | fields User_Name]

| search _key=\"" + key + "\"

| outputlookup open_cases append=true | eval key=_key&lt;/LI-CODE&gt;
&lt;P&gt;Can you help me to get the right username value?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Mauro&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jun 2020 21:38:41 GMT</pubDate>
    <dc:creator>maurobissante</dc:creator>
    <dc:date>2020-06-15T21:38:41Z</dc:date>
    <item>
      <title>Javascript take splunk username</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Javascript-take-splunk-username/m-p/504431#M4547</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm trying to get the Splunk user that making changes in kv store. I tried to use the rest call but the User_Name fields return "&lt;SPAN&gt;undefined". I launch this search from javascript.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup open_cases

| eval Notes=if(_key=\"" + key + "\",\"" + mod_notes + "\",Notes), Status=\"Work-in-progress\"

| appendcols [ | rest /services/authentication/current-context | rename username AS User_Name | fields User_Name]

| search _key=\"" + key + "\"

| outputlookup open_cases append=true | eval key=_key&lt;/LI-CODE&gt;
&lt;P&gt;Can you help me to get the right username value?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Mauro&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 21:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Javascript-take-splunk-username/m-p/504431#M4547</guid>
      <dc:creator>maurobissante</dc:creator>
      <dc:date>2020-06-15T21:38:41Z</dc:date>
    </item>
  </channel>
</rss>

