Create, deploy, and maintain analytic applications that engage users and drive revenue. See a Logi demo

Development Tips

Logi Tutorial: How to Use an AWS S3 Export Plugin Within Your Logi Application

By Mahyar Ghasemali | May 2, 2019
Share on LinkedIn Tweet about this on Twitter Share on Facebook

This post originally appeared on dbSeer, a business analytics consulting firm and Logi Analytics partner.

Enabling a direct export to a Secure, Scalable and Reliable AWS S3 storage will make your Logi Analytics application even more powerful. Contents stored in an S3 bucket can be secured with different security options like bucket policies and permissions to make it available to individuals or group of people or to the entire internet. S3 guarantees 11 9’s durability and 99.99% availability with virtually unlimited storage.

This blog will walk you through 9 easy steps to build an AWS S3 export plugin and use it within a Logi Analytics application. You first need to create and build the Export to S3 Plugin (a dll), and then call this plugin within your Logi Analytics application with all the required parameters. Our example shows how to create and use a .NET dll to check for an existing file and copy files to AWS S3. (Note that our example uses C#.NET, however the same plugin can be built in Java).

Creating the Plugin (dll)

  1. Add the reference for the rdPlugin.dll, which is located in the Logi application folder \bin directory. and the following AWS DLL references are required
    • AWSSDK.Core
    • AWSSDK.S3
  2. Include the following namespaces in the class:
    • rdPlugin
    • Amazon
    • Amazon.S3
    • Amazon.S3.Transfer

  3. Use the sendFileToS3 method, which will be called from the Logi Analytics application. (This method must be public and can have only one ref input parameter of type rdServerObjects.)
    • Note that any parameters that are added in the Logi plugin call are encapsulated under rdObjects.PluginParameters and can be accessed as shown below (rdObjects, the ref parameter, is passed to the method.)

  4. Initialize the S3 client and transfer utility as shown below. You need to initialize the S3Client utility with the AccessKeyID, SecretAccessKey, and Region parameters. (These can be null if the proper bucket policy is set or if the appropriate role is set in the EC2 instance.)
  5. Optionally, you can check for the existence of the file and provide a warning about overwrite (otherwise, files can get overwritten by default).
  6. Transfer the file to S3 as shown below:

 

 

 

 

 

 

 

Build the dll with the following namespace and class, and then copy the S3Utility, AWSSDK.S3, and AWSSKD.Core DLLs to the Logi application folder \bin directory.

AWS S3 Plugin for Logi Analytics ApplicationAWS S3 Plugin for Logi Analytics Application

Using the Plugin in Logi Application

  1. Note the class type name S3Utility.AMZS3Utility (namespace.classname)You are now all set to use the plugin in the Logi app. Calling the plugin method sendFiletoS3 from a task is as simple as this:AWS S3 Plugin for Logi Analytics Application
  2. Pass the parameters to the plugin as shown below (these were the parameters accessed in the code example in Step 4 above).
      1. awsAccessKeyID and awsSecretAccessKey are required to authenticate and process the S3 request
      2. as shown in this example, with an adjusted S3 bucket policy the same code can export to S3 without awsAccessKeyID and awsSecretAccessKeyAWS S3 Plugin for Logi Analytics Application

 

Check out more Logi tutorials for AWS:

 

About the Author

Mahyar is an expert in business analytics, database optimization, and agile development. Before founding dbSeer, Mahyar led software development at Telarix, where he managed a globally dispersed team and focused on building scalable, high-performance business and network applications for the telecom industry. Prior to Telarix, Mahyar was head of professional services at Logi Analytics, where he oversaw the delivery of business analytics solutions in various industries, including advertising, healthcare, and telecommunications. Mahyar holds a bachelor degree in computer science from Azad University in Tehran.

Subscribe to the latest articles, videos, and webinars from Logi.