Striim 3.10.2 documentation

Table of Contents

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.


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.


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.


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> 
{ <integer> { SECOND | MINUTE | HOUR } |
  JUMPING <integer> { SECOND | MINUTE | HOUR } |
  <integer> { SECOND | MINUTE | HOUR } AND PUSH }
] ...
  • [<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.

  • Do not specify both JUMPING and AND PUSH.

  • 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.

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

The SAMPLE BY clause (see CREATE CQ (query) may be useful when a visualization contains too many data points. For example, consider this chart using PosApp data with the query SELECT * FROM MerchantActivity ORDER BY time:


The dashboard shows as much of the data as it can hold, which is only the last half hour. If you change the query to SELECT * FROM MerchantActivity ORDER BY time SAMPLE BY count, the dashboard can show 3-1/2 hours of data: