Versions Compared

Key

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

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

3
Table of Contents
maxLevel3
minLevel

Adding an analytic script

1. Log on to the BAM Management Console and

...

click Analytics on the Add menu of the Main menu. That will open the Script Editor window.

Image Modified

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

Image Modified

Info
titleNote

For information on writing HiveQL scripts,

...

see https://cwiki.apache.org/confluence/display/Hive/LanguageManual.

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

Image Modified

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

5. The script will be redirected to Available Scripts page where saved script are listed.

Image Modified

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 edit a script that came with a BAM toolbox

...

:

  1. Go to to <BAM_HOME>/repository/deployment/server/bam-toolbox folder  folder and select the .tbox file  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 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 tbox file in the same same bam-toolbox folder  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
  2. select
  3. click List
  4. under
  5.  in the  Analytics
  6. menu
  7.  menu in
  8. the
  9. the Main
  10. menu
  11.  menu.
    Image Modified
  12. Select the script you want to edit and

  13. click
  14. click Copy as a New Script

  15. link
  16.  link associated with it. 
    Image Modified

  17. Note that you
  18. Info

    You cannot use the management console to edit a script after it is deployed. The only

  19. want
  20. way to do this through the UI is, by duplicating the old script and renaming it

  21. .
  22. Do
  23. your
  24. required modifications to the existing script and save it in a new name.