Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the instructions below to add/edit an analytic script in WSO2 BAM:

Table of Contents
maxLevel3

Adding an analytic script

1. Log on to the BAM Management Console and select Analytics-> Add menu from the Main menu. That will open the Script Editor windowclick Analytics on the Add menu of the Main menu. That will open the Script Editor window.

2. Provide a script name, and add the required HiveQL script in the editor pane as shown below.

Info
titleNote

For information on writing HiveQL scripts, refer to https://cwiki.apache.org/confluence/display/Hive/LanguageManualsee Hive Language Manual.

3. You can click  Click Run to  to execute the script and view results. The results appear in the panel below the script editor as shown in the screenshot below.

4. Click  Click Save to  to save the script. Click Click No in  in the pop up dialog box if it is not required to schedule the script immediately. Else, click click Yes to  to schedule the script before saving. For more information on scheduling, refer to section see Scheduling an Analytic Script.

5. The  The script will be redirected to added to Available Scripts page where , where saved script are listed as show below.

Editing an analytic script

There are two ways to edit an analytic script as follows:

Editing scripts installed with toolboxes

Follow the instructions below  to to edit a script that came with a BAM toolbox:

  1. Go Navigate to <BAM_HOME>/repository/deployment/server/bam-toolbox folder / directory, and select the.tbox file you want to edit.
  2. Open the .tbox file using any file archiving utility (e.g. , 7z).
  3. Edit the script file in the toolbox according to your requirements. Scripts are saved inside the Analytics folder in the .tbox file.
  4. Once the edits are done, archive the main folder again and simply change its extension to .tbox.
  5. Save the edited .tbox file in the same bam-toolbox folder mentioned above and restart the server.

Editing scripts added manually

If you have already installed BAM, you can change analytics scripts that are manually added, using the management console as follows:

  1. Log in to the BAM management console, and click List in the Analytics menu in the Main menu.
  2. You cannot use the management console to edit a script after it is deployed. The only way to do this through the UI is, by duplicating the old script and renaming it

    Select Click Edit corresponding to the script you want to edit and click Copy as a New Script link associated with it. 
    Image Removed

    Info

    and as shown below. 
    Image Added

  3. Do required modifications to the existing script and save it in a new name.