MWA (Machbase Web Analytics)

List of Contents

Machbase Web Analytics (MWA) is a web application developed with Python 2.7 Micro Framework Flask based on Werkzeug and Jinja2.


MWA uses port 5001. To check whether the port is blocked, issue iptables command. To change server ports, refer to server port command below. $MACHBASE_HOME/lib folder must be added to $LD_LIBRARY_PATH, and file needs to be located in the path as well in order to execute Machbase Web Analytics.

How to run the Server

Shell scripts are supported to run the server.
The location of the shell script is $ MACHBSE_HOME/webadmin/flask/MWAserver.
Since the script is based on $ MACHBASE_HOME, you need to set the environment variables.
It supports START, STOP, RESTART, RESET, and PORT commands. If you enter 'MWAserver start' command to run the first server, the Machbase Web Analytics server will run. The initial server port value is set to 5001.

The port command is used to change the server port number. Input values are numeric only.


[mach@localhost ]$./MWAserver port 1234

You will find the list of the commands and its descriptions, which guide you how to run the server in below.

List of commands

[mach@localhost flask]$./MWAserver help

List of commands:
  * MWAserver start; Startup WebServer

  * MWAserver restart; Restart WebServer

  * MWAserver stop; Shutdown WebServer

  * MWAserver reset; Reset WebServer database
  * MWAserver port NUMBER; Change WebServer port.

Connect to MWA with Web Browser

You can access the server with IP and port number where MWA is currently operating via Chrome browser or the latest version of Internet Explorer. If you successfully accessed to the server, you can see the login screen. But, it is recommended to use Chrome as MWA is best optimized for Google Chrome. ID and password of MWA are set as "admin" and "machbase" respectively by default.


How to Use MWA

MWA is consisted of Dashboard, Query, Collection, DB Admin, and Preferences.


User Authentication
There are two types of user authentication: ADMIN and USER. The user with the ADMIN account is allowed to access all contents. With the USER account, you cannot access to Server and Categories from the menu. It only allows you to change your information in the Users. You can find the Users category under Preferences.

It is used for categorizing and managing stored Query, Grid, Chart and Dashboard. You can select the available categories from the Group on the upper left corner of the screen. User-defined categories can be registered in "Available Groups" from "Users" menu. If Authority is set as ADMIN, the user has the full authentication and it also has the authentication over Grids of other users.
Only ADMIN user can register a Group to Available Groups.

It sets the range of public scope about the stored Bookmark Query, Grid and Dashboard. There are three types of scope: ALL, USER and OWNER.
ALL: all users can access the contents without log in.
USER: only logged in users can access the contents.
OWNER: the owner can access the contents.

Only ADMIN users, OWNER, the users with ADMIN authentication over the category can modify without permission.

Change a Server
You can change the server, located right next to admin, on the upper right corner of the screen. It can only work properly when the Machbase server is running. When you hover mouse pointer over the selected server, you can check IP and port number of the server.


It provides features to search query results with Grid, Chart and Dashboard. You can create Grid and Chart first and then select and register the created one to the Dashboard. Once it is registered to the Dashboard, it will not be affected even though the original Grid or Chart is modified.

Users can create, modify, delete, select from the list and simple information can be modified in the Dashboard Information located on the right side. Also, you can directly insert URL using "Link URL" on the lower-right side of the screen without using menu. As explained above, users able to access different contents based on the granted permissions. To access contents without log in, must set the permission to ALL.



Users can create and select Dashboard by using stored Charts and Grids. Click "Row+" to add a row and click "Row-" button to delete a row from the bottom. Row cannot be deleted if there is a panel. With "Chart+ Grid+ HTML+ URL+" buttons, a panel can be added to a desired row. Users can select and register one of stored Charts and Grids. However, when Charts or Grids with defined variable, it cannot be registered. The variable is the feature to receive data from the users.

With HTML, users can create panels by using HTML and Javascript, and jquery and chart.js are available as well. If ID attribute is used, it can be duplicated with the ID that is already being used in the Dashboard. Therefore, it is recommended to use ID in the form of "_ID." Caution should be exercised when using a URL, it cannot be accessed due to the settings of 'X-Frame-Options'. When checking Dashboard, it can stop or re-start refresh per each panel. Thus, it can prevent all panels being refreshed.


It can search the results with Graph by using query statements. Users can check the query results in the "Result" and select preferences in the "Setting" tab. The contents of the settings can be checked in the "Chart" tab.

MWA supports "Builder" to create time series chart easily. Users can set time intervals that will be aggregated with columns of X axis and specify a column that will be used for Y axis. If a column of Y axis has numeric values, functions like SUM and AVERAGE can be used. If not, Record Count can be used. For time series graph, line chart is set as default. The default settings can be changed in the "Setting" tab.

If you want to make Grid displayed on the bottom of Chart screen, click "Config" button and then select columns from "Columns" tab. When you add random numbers for Width, it determines width of columns after calculating the ratio from the sum of the width. For example, each column of width is 1, 2, 1 respectively, then, width of each column would be 25%, 50% and 25%.

When you are using Chart and want to use variables of query statements by entering them directly, you must register variables to "Variables" tab first by using "Config" button. Text, number, date, time, datetime, and select can be used for variables. Variable name can be encapsulated with { } in a query statement. Then, it can be replaced with data that the user inserted. It is simply replacing the variable name with the user inserted data, thus, if strings are used, these strings must be quoted. For SELECT statement, users need to separate items by using ',' in the options. In this case, the first item would be the default value.


If you click "Preview" button, it will display the result before saving the data. In the View screen, if you use "Output" button, the results can be saved in Excel, JSON, CSV and TDE(Tableau data extract). If you store the results in excel file, the chart results will be converted and displayed in a very similar format.


It allows you to issue queries and retrieve the selected results in table format. You can also retrieve the columns that you want to see excluding columns that you don't need to see from the list.
With "Builder" button, you can easily create WHERE clause of a query statement. However, this button only provides simple features so if a function is required for WHERE clause or complicated query statements are required, it is better to type query statements by yourself.
If you want to select desired columns, click "Config" button and specify a title and width for a column by using "+" button from "Columns" tab. When a random number is inserted for width, it calculates the ratio of width with the inserted number and then determine the width of a column.

If you want to create query statements in the "Variables" tab, users can retrieve data that they want to check by setting variables. Enclose "Variable Name" with { } in a query statement and execute it. Then, it will replace the enclosed variable name with contents that the user inserted. It only transforms {Variable Name} to the user input so that it requires quotation marks for string characters.

"Preview" button enables you to preview the results before saving them.
Click "Output" button from View screen to store the results in Excel, JSON, CSV, or TDE(Tableau data extract) format.



It can select results from a database. by issuing query statements. Inserted contents will be displayed on the right panel if LIMIT or DURATION is not used.

It allows to store and re-use a query statement and select and re-use query history that was already used. It also can move to the create Grid or Chart screen. However, only query statements can be move to the create screen, not LIMIT or DURATION settings. Bookmarked queries can be found in the " Bookmark Queries."

In the "Tables"tab, you can check lists of table and a schema of each table as well. Click a name of table, then you can check the contents of that table. Records are refreshed every 5 seconds. In the Result tab, you can retrieve query results. If "Input selected text at cursor position" is selected in the checkbox, each time results are selected, at a current cursor position in the input window, the results will be inserted. It can also store query results by using features to display outputs along with Grid and Chart.

Table Explorer
It selects the contents of tables. It aggregates data from the specified period based on time interval and then displays it in graph. When you drag a specified point from the graph, you can see the data within the period.
On the upper right side of the screen, there is ON/OFF button to disable or able the zoom mode. It also load tables again. If the zoom mode is on and you drag the graph, the selected part will be enlarged. You can check the contents of that time period by just clicking that point.

Bookmark Queries

It manages bookmarked queries from SQL. When you click an item from the list, you can see information on the panel. It can move to SQL menu by using the button(to SQL).


Data Collection
The registered collector managers and lists of collectors will be aggregated in a tree format based on a table unit from the database. Template file (.tpl), regex file (.rgx) and preprocess file (.py) must be located in the specified path of MACHBASE_HOME.
Template file (
.tpl): $MACHBASE_HOME/collector
Regex file (.rgx): $MACHBASE_HOME/collector/regex
Preprocess file (
.py): $MACHBASE_HOME/collector/preprocess

In a table, the number of records will be displayed on the right next to the icon of an eye. When you hover your mouse over the eye icon, "View Table" window will be appeared. If you click the icon, it will take you to "Table Explorer" to check the contents. And below tables show execution states whether the collector or collector manager is running, and collection speed. On the right side of each collector, you can find three little icons representing START, STOP and DROP commands.

Click "add Manager" button to execute the collector manager in a separate popup window. In this window, you can register a collector manager with "Create Manager" button, and can find the three icons on the right side representing RENAME, DROP and LIST features. LIST will display all the collectors that are registered to the collector manager.

You can create a collector with "add Collector" button. Select the collector manager first and insert a collector name. The collector name must be unique in the collector manager.

To click "Template" button, a window will be appeared. You can manage templates in this window and click "New" button to create a new template. at the end of each template, there is an icon to edit the existing template. With this feature, you can create a new template by changing the name of the existing template and save. Caution must be exercised to check whether DB_ADDR and DB_PORT are correct before saving them. If hovering your mouse over a box where you type in or select items, you can find the information form tooltip description..


It manages script files of preprocess that are used in the template file. If you select a collector manager from the upper right corner of the screen, it fetches the list of preprocess script files. To click "Reload" button under of the collector manager, it fetches the list of script files again.

To click a preprocess script file, you can select and modify the contents, and even initialize the script contents by clicking "New" button. Aslo the contents of the script file will be displayed on the left side. To click "Save" button, it can save inserted contents. In this case, if a new file name is inserted, a new script file will be created.

Regular Expression

It manages regular expression files that are used in template files. When you select a collector manager on the upper right corner of the screen, it fetches the list of regular expression files. To click "Reload" button under the collector manager, it fetches the list of regular expression files again.

When you click a regular expression file from the list on the right side, you can select and modify the contents, and even initialize the contents of regular expressions and create a new regular expression by clicking "New" button.

Insert regular expressions on the top. See below for detailed instructions.
Regex(REGEX): regular expression to analyze data.
Start(START_REGEX): a regular expression to represent a starting point of data. It is included for REGEX analysis.
End(END_REGEX) : a regular expression to represent a ending point of data. It is excluded for REGEX analysis.

  • If END_REGEX is not inserted, a collector will not be operated.

On the bottom of the screen, a table of column list will be displayed. In the table, it lists the results of regular expressions that will be stored in tables. Regex No is the result number representing execution results of machregex and the rest of them are a column name, type, and size of a table. These items can be added, modified and deleted.

Click Test tab to conduct sample test. Insert sample data and click "Test" button on the right side of the tab, "Test Regex" window will be displayed so that users can check the execution results of machregex. If the test results are succeeded, select columns from Columns tab to use. The message will be displayed on the window telling you whether the test was succeeded. If so, fill out related information for column name, type and size. When you click "Apply" button, it will organize the column list again. And the existing column list will be disappeared.

DB Admin

It manages tables and table spaces. It checks schema and indexes of tables.

Running Queries
It selects the currently operating queries. If the currently operating queries are not required, it can make it stop.

System Monitoring
This is a dashboard to monitor system information of Machbase Web analytics Server. If there is item or information that cannot be obtained from the server, it will be left in a blank.
If you wan to monitor other server, MWA must be operating in that server and you can access it if you have "Web URL" that was used when register the server.


Register a server. Users with ADMIN authentication can access it.

Server name It will be used for IP and port.
Host and Port It is IP and port to access Machbase DB. If the sever is the same as Machbase Web Analytics, or localhost can be used.
Web URL Users can access the server with this URL from their machines.
UserID and Password User ID and password to access Machbase database.

At least one server must be maintained, and for Machbase DB, it is able to execute commands to control the server with "Command" button. When MWA is currently operating, for another Machbase DB, all features can be used except commands that are controlled by "Command" button. If another Machbase database is installed in other server and MWA is operating, that Machbase database can be controlled by "Command" button.

How to change your private IP to public IP

Please change your private IP to public IP in the following way.
1) Go to MWA> Preferences> Servers.
2) Action - Edit server: change server settings.
3) Host: Enter the IP to be changed.
4) Click the "OK" button.

It manages available groups. Users with ADMIN authentication can access. Groups registered here can be used for categorizing Chart, Grid, Dashboard, and Bookmark Query.

It manages users. Users here mean that users who use Machbase Web Analytics not Machbase database users.

It can set starting screen of users. Starting screen can choose from System Dashboard, SQL and Dashboard. If Dashboard is selected, it can select one of available dashboard should be selected as starting screen.

ADMIN users can register available servers and groups for each user.
Available Groups: set ADMIN/USER to Authority.
Available Servers : set default server.

Users with USER authentication can only modify their information such as password.

results matching ""

    No results matching ""