<?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 On a modular input built with JavaScript SDK, how do I set and retrieve a password that is entered on creation of the input? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/On-a-modular-input-built-with-JavaScript-SDK-how-do-I-set-and/m-p/405042#M6978</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a customer modular input built with JavaScript SDK.  I am trying to set and retrieve a password that is entered on creation of the input.  I am looking for assistance on how this endpoint works and where it should reside within the code. &lt;/P&gt;

&lt;P&gt;In "validateInput" &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var obj = {
                    username: username, 
                    password: password
                  }
        // Create a new storage password
        sp.create(obj, function(err, storagePassword) {
                if (err) { /* handle error */ }
                else {
                    // Storage password was created successfully
                    Logger.log(sp.properties());

                }
            }
        );

In "streamEvents"

sp.fetch(function(err, storagePasswords) {
            if (err) 
                { /* handle error */ }
            else {
                Logger.log("Found " + storagePasswords.list().length + " storage passwords");
                //get the pwd value somehow?
                list = storagePasswords.list()
                for(var i = 0; i&amp;lt;list.length; i++){
                    if(username == list[i].username){
                        pwd == list[i].content.clear_password
                    }
                }
            }
        });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This doesn't seem to set or retrieve so I am clearly doing something wrong. &lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 17:42:25 GMT</pubDate>
    <dc:creator>mcrooks</dc:creator>
    <dc:date>2018-10-02T17:42:25Z</dc:date>
    <item>
      <title>On a modular input built with JavaScript SDK, how do I set and retrieve a password that is entered on creation of the input?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/On-a-modular-input-built-with-JavaScript-SDK-how-do-I-set-and/m-p/405042#M6978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a customer modular input built with JavaScript SDK.  I am trying to set and retrieve a password that is entered on creation of the input.  I am looking for assistance on how this endpoint works and where it should reside within the code. &lt;/P&gt;

&lt;P&gt;In "validateInput" &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var obj = {
                    username: username, 
                    password: password
                  }
        // Create a new storage password
        sp.create(obj, function(err, storagePassword) {
                if (err) { /* handle error */ }
                else {
                    // Storage password was created successfully
                    Logger.log(sp.properties());

                }
            }
        );

In "streamEvents"

sp.fetch(function(err, storagePasswords) {
            if (err) 
                { /* handle error */ }
            else {
                Logger.log("Found " + storagePasswords.list().length + " storage passwords");
                //get the pwd value somehow?
                list = storagePasswords.list()
                for(var i = 0; i&amp;lt;list.length; i++){
                    if(username == list[i].username){
                        pwd == list[i].content.clear_password
                    }
                }
            }
        });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This doesn't seem to set or retrieve so I am clearly doing something wrong. &lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 17:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/On-a-modular-input-built-with-JavaScript-SDK-how-do-I-set-and/m-p/405042#M6978</guid>
      <dc:creator>mcrooks</dc:creator>
      <dc:date>2018-10-02T17:42:25Z</dc:date>
    </item>
  </channel>
</rss>

