Login Information Parser

Overview

The Smart Service, Import Login Audit, will read your login audit file(s) and populate a database with information about logins.  This is provided mainly as an example (source code provided) as you may need to modify the smart service to make it work with your environment.

  • Requires a table named "logins" in the specified datasource.  The example SQL is provided.
  • Inputs:
    • datasourceName: The datasource where the login information will be populated
    • date: The date suffix for the login_audit.csv* file to be read. If null, it reads the latest file.
  • Supports MySQL, Oracle and Microsoft SQL Server databases
Anonymous
Parents
  • Hi


    Hope your doing Well!
     
    Observed the below issues with the plug-in.
    1. When we pass the date as rule input to smart service but unfortunately if the log file is not exist on that date, the smart service is throwing the java.lang.NullPointerException. Is there any chance to handle in java code?.
    2. The second one is which mentioned by

    Can you please help out on this.
    Thanks!!

Comment
  • Hi


    Hope your doing Well!
     
    Observed the below issues with the plug-in.
    1. When we pass the date as rule input to smart service but unfortunately if the log file is not exist on that date, the smart service is throwing the java.lang.NullPointerException. Is there any chance to handle in java code?.
    2. The second one is which mentioned by

    Can you please help out on this.
    Thanks!!

Children
  • Hi

    Today also, observed same issue ..

    logs error:

    2019-11-07 00:58:54.843 INFO [commons-pool-EvictionTimer] com.appiancorp.a2.vpn.VPNTunnelNameService.lookupAllHostAddr VPN dns lookup result 10.3.69.0
    java.io.FileNotFoundException: /usr/local/appian/ae/logs/login-audit.csv.2019-11-06 (No such file or directory)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(FileInputStream.java:195)
    	at java.io.FileInputStream.<init>(FileInputStream.java:138)
    	at java.io.FileInputStream.<init>(FileInputStream.java:93)
    	at com.appiancorp.loginparser.ImportLoginInformation.processLogins(ImportLoginInformation.java:97)
    	at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:87)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:35)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:84)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    java.lang.NullPointerException
    	at java.io.Reader.<init>(Reader.java:78)
    	at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
    	at com.appiancorp.loginparser.ImportLoginInformation.writeLogins(ImportLoginInformation.java:110)
    	at com.appiancorp.loginparser.ImportLoginInformation.processLogins(ImportLoginInformation.java:101)
    	at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:87)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:35)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:84)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    2019-11-07 01:00:03,454 [Appian Work Item - 183550 - execution01 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=268475705, classname=com.appiancorp.loginparser.ImportLoginInformation
    com.appiancorp.suiteapi.process.exceptions.SmartServiceException: java.lang.NullPointerException
    	at com.appiancorp.suiteapi.process.exceptions.SmartServiceException$Builder.build(SmartServiceException.java:145)
    	at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:90)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:35)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:84)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NullPointerException
    	at java.io.Reader.<init>(Reader.java:78)
    	at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
    	at com.appiancorp.loginparser.ImportLoginInformation.writeLogins(ImportLoginInformation.java:110)
    	at com.appiancorp.loginparser.ImportLoginInformation.processLogins(ImportLoginInformation.java:101)
    	at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:87)
    	... 16 more


    The file updated time


    PM has run at 1:00 Am GMT 7th Nov 2019 with above log error.
    After i restart at 5:05 Am GMT it got executed without error.

    Please help on this
  • Hi ,

    In my case- log file exist . The scheduled process is at 1:00 Am GMT. The Instance failed for above error log has the file updated at -added screen shot(Thu, 31 Oct 2019 19:36:45 GMT)

    So,. the PM which run's at Nov 1st 1:00 Am GMT failed with above error. however it worked when i restart the node today.

    Can you please help on this ? let me know if u need any other info.

  • i am also facing 1st issue and shows null pointer exception.. and when i try to restart they have being parsed ..

    2019-11-01 01:00:03,793 [Appian Work Item - 110192 - execution00 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=93915, classname=com.appiancorp.loginparser.ImportLoginInformation
    com.appiancorp.suiteapi.process.exceptions.SmartServiceException: java.lang.NullPointerException
    	at com.appiancorp.suiteapi.process.exceptions.SmartServiceException$Builder.build(SmartServiceException.java:145)
    	at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:90)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:35)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:84)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NullPointerException
    	at java.io.Reader.<init>(Reader.java:78)
    	at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
    	at com.appiancorp.loginparser.ImportLoginInformation.writeLogins(ImportLoginInformation.java:110)
    	at com.appiancorp.loginparser.ImportLoginInformation.processLogins(ImportLoginInformation.java:101)
    	at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:87)
    	... 16 more
  • Hi Eduardo,

    Please find below log details.

    2019-10-31 07:11:36,195 [Appian Work Item - 13064 - execution03 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=6293233, classname=com.appiancorp.loginparser.ImportLoginInformation
    com.appiancorp.suiteapi.process.exceptions.SmartServiceException: java.lang.NullPointerException
    at com.appiancorp.suiteapi.process.exceptions.SmartServiceException$Builder.build(SmartServiceException.java:145)
    at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:90)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:131)
    at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:131)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:125)
    at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:25)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:125)
    at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:83)
    at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    at com.appiancorp.process.engine.ContinuationRequest.executeOuter(ContinuationRequest.java:71)
    at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:100)
    at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:35)
    at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:84)
    at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.NullPointerException
    at java.io.Reader.<init>(Reader.java:78)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
    at com.appiancorp.loginparser.ImportLoginInformation.writeLogins(ImportLoginInformation.java:110)
    at com.appiancorp.loginparser.ImportLoginInformation.processLogins(ImportLoginInformation.java:101)
    at com.appiancorp.loginparser.ImportLoginInformation.run(ImportLoginInformation.java:87)
    ... 16 more

    Thanks!!

  • Can you provide me with the actual error from the logs so I can see what line throws this?