Striim 3.9.6 documentation

Defining dashboard queries

Once you have added a new visualization to a dashboard, the next step is defining its query. Until you do this, the drop-down field menus in the visualization editor will be empty.

donut_for_query_discussion.png

For example, the query for the PosApp donut chart above is:

select count(*) as Count, Status from MerchantActivity group by Status;

This results in four Count values representing the number of merchants with each status. The Count values control the size of the slices and the Status values provide the labels.

Note

When you save a query, the previous version is overwritten, and there is no record of it within Striim. Thus, if you are making substantial changes, it is a good idea to give the query a new name so as to preserve the original, or to copy the original and paste it in a text editor.

Note

The dashboard page- and visualization-level filters (see Dashboards page) are available only when querying a WActionStore that is persisted to Elasticsearch (see CREATE WACTIONSTORE).

By default, dashboard queries are executed only once, when the visualization is loaded. To update the data, refresh the browser to reload the visualization.

To have the a query update continuously, enable polling in the visualization properties. (This property is hidden if the query contains AND PUSH). The query will then be re-run every five seconds, or, if the query takes longer, as soon as it completes.

When querying a WActionStore, the following additional syntax is available:

SELECT ... FROM <WActionStore> 
[ [ JUMPING ]
  <integer> { SECOND | MINUTE | HOUR } 
  [ AND PUSH ] 
] ...

The first and last brackets are literal. The others indicate optional clauses.

Any WHERE, GROUP BY, HAVING, ORDER BY, or LIMIT clause must follow the ]. When PUSH is specified, polling is disabled.

<time period> without JUMPING or AND PUSH returns data for the specified period and does not update until you reload the page.

[JUMPING <time period] immediately returns data for the specified time period and runs the query again at the same interval. For example, SELECT * FROM MerchantActivity [JUMPING 1 MINUTE] returns data for the past minute and then runs the query again every minute, so you always have one minute's worth of data that is never more than one minute old.

[<time period> AND PUSH] returns data for the specified time period and adds more data every time an event is added to the WActionStore. For example, SELECT * FROM MerchantActivity [15 MINUTE AND PUSH] returns data for the past 15 minutes and adds new events indefinitely. Old data is not removed until you reload the page.

It is essential, particularly when using AND PUSH, to include LIMIT and ORDER BY clauses in the query to avoid overloading the dashboard with more data than it can display.

Do not specify both JUMPING and AND PUSH.