[
https://issues.apache.org/jira/browse/NIFI-3349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16191550#comment-16191550
]
ASF GitHub Bot commented on NIFI-3349:
--------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/nifi/pull/2149
> GetSplunk Should Periodically Re-Authenticate
> ---------------------------------------------
>
> Key: NIFI-3349
> URL: https://issues.apache.org/jira/browse/NIFI-3349
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.0.0, 0.6.0, 0.7.0, 0.6.1, 1.1.0, 0.7.1, 1.1.1, 1.0.1
> Reporter: Bryan Bende
> Priority: Minor
>
> 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:
> {code}
> 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;
> }
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)