Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-3349

GetSplunk Should Periodically Re-Authenticate

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0.0, 0.6.0, 0.7.0, 0.6.1, 1.1.0, 0.7.1, 1.1.1, 1.0.1
    • 1.5.0
    • None
    • None

    Description

      The first time the processor executes, it lazily initializes the Splunk Service object:

      https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/GetSplunk.java#L372-L377

      As part of this initialization, the Splunk service calls a login method like this:

      public Service login(String username, String password) {
              this.username = username;
              this.password = password;
      
              Args args = new Args();
              args.put("username", username);
              args.put("password", password);
              args.put("cookie", "1");
              ResponseMessage response = post("/services/auth/login", args);
              String sessionKey = Xml.parse(response.getContent())
                  .getElementsByTagName("sessionKey")
                  .item(0)
                  .getTextContent();
              this.token = "Splunk " + sessionKey;
              this.version = this.getInfo().getVersion();
              if (versionCompare("4.3") >= 0)
                  this.passwordEndPoint = "storage/passwords";
      
              return this;
          }
      

      Since this only happens the first time the processor executes, it will only happen again if you stop and start the processor. If the processor has been running long enough that session probably expired and the processor is continuing to attempt to execute.

      We should periodically call service.login() in a timer thread.

      Attachments

        Issue Links

          Activity

            People

              bbende Bryan Bende
              bbende Bryan Bende
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: