This is the multi-page printable view of this section. Click here to print.
Dashboards
- 1: Queries
- 2: Internal Links
- 3: Direct URLs
1 - Queries
Dashboard queries are created with the query expression builder. The expression builder allows for complex boolean logic to be created across multiple index fields. The way in which different index fields may be queried depends on the type of data that the index field contains.
Date Time Fields
Time fields can be queried for times equal, greater than, greater than or equal, less than, less than or equal or between two times.
Times can be specified in two ways:
-
Absolute times
-
Relative times
Absolute Times
An absolute time is specified in ISO 8601 date time format, e.g. 2016-01-23T12:34:11.844Z
Relative Times
In addition to absolute times it is possible to specify times using expressions. Relative time expressions create a date time that is relative to the execution time of the query. Supported expressons are as follows:
now()
- The current execution time of the query.second()
- The current execution time of the query rounded down to the nearest second.minute()
- The current execution time of the query rounded down to the nearest minute.hour()
- The current execution time of the query rounded down to the nearest hour.day()
- The current execution time of the query rounded down to the nearest day.week()
- The current execution time of the query rounded down to the first day of the week (Monday).month()
- The current execution time of the query rounded down to the start of the current month.year()
- The current execution time of the query rounded down to the start of the current year.
Adding/Subtracting Durations
With relative times it is possible to add or subtract durations so that queries can be constructed to provide for example, the last week of data, the last hour of data etc.
To add/subtract a duration from a query term the duration is simply appended after the relative time, e.g.
now() + 2d
Multiple durations can be combined in the expression, e.g.
now() + 2d - 10h
now() + 2w - 1d10h
Durations consist of a number and duration unit. Supported duration units are:
s
- Secondsm
- Minutesh
- Hoursd
- Daysw
- WeeksM
- Monthsy
- Years
Using these durations a query to get the last weeks data could be as follows:
between now() - 1w and now()
Or midnight a week ago to midnight today:
between day() - 1w and day()
Or if you just wanted data for the week so far:
greater than week()
Or all data for the previous year:
between year() - 1y and year()
Or this year so far:
greater than year()
2 - Internal Links
Within Stroom, links can be created in dashboard tables or dashboard text panes that will direct Stroom to display an item in various ways.
Links are inserted in the form:
[Link Text](URL and parameters){Link Type}
In dashboard tables links can be inserted using the link()
function or more specialised functions such as data()
or stepping()
.
In dashboard text panes, links can be inserted into the HTML as link
attributes on elements.
Note
The text pane must be set toShow As HTML
for links to operate.
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer" link="[link](uuid=e177cf16-da6c-4c7d-a19c-09a201f5a2da&params=user%3Duser1&title=Details%20For%20user1){dashboard}">Details For user1</span>
</div>
The link type can be one of the following:
dialog
: Display the content of a link URL within a stroom popup dialog.tab
: Display the content of a link URL within a stroom tab.browser
: Display the content of a link URL within a new browser tab.dashboard
: Used to launch a Stroom dashboard internally with parameters in the URL.stepping
: Used to launch Stroom stepping internally with parameters in the URL.data
: Used to show Stroom data internally with parameters in the URL.annotation
: Used to show a Stroom annotation internally with parameters in the URL.
Dialog
Dialog links are used to embed any referenced URL in a Stroom popup Dialog. Dialog links look something like this in HTML:
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[Show](https://www.somehost.com/somepath){dialog|Embedded In Stroom}">
Show In Stroom Dialog
</span>
</div>
Note
The dialog title can be controlled by adding a|
and required title after the type, e.g.
{dialog|Embedded In Stroom}
Tab
Tab links are similar to dialog links are used to embed any referenced URL in a Stroom tab. Tab links look something like this in HTML:
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[Show](https://www.somehost.com/somepath){tab|Embedded In Stroom}">
Show In Stroom Tab
</span>
</div>
Note
The tab title can be controlled by adding a|
and required title after the type, e.g.
{tab|Embedded In Stroom}
Browser
Browser links are used to open any referenced URL in a new browser tab.
In most cases this is easily accomplished via a normal hyperlink but Stroom also provides a mechanism to do this as a link event so that dashboard tables are also able to open new browser tabs.
This can be accomplished by using the link()
table function.
In a dashboard text pane the HTML could look like this:
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[Show](https://www.somehost.com/somepath){browser}">
Show In Browser Tab
</span>
</div>
Note
Unlike the other link types there is no way to control the browser tab title.Dashboard
In addition to viewing/embedding external URLs, Stroom links can be used to direct Stroom to show an internal item or feature.
The dashboard
link type allows Stroom to open a new tab and show a dashboard with the specified parameters.
The format for a dashboard link is as follows:
[Link Text](uuid=<UUID>¶ms=<PARAMS>&title=<CUSTOM_TITLE>){dashboard}
The parameters for dashboard links are:
uuid
- The UUID of the dashboard to open.params
- A URL encoded list of params to supply to the dashboard, e.g.params=user%3Duser1
.title
- An optional URL encoded title to better identify the specific instance of the dashboard, e.g.title=Details%20For%20user1
.
Note
Parameter values can be URL encoded in XSLT using theencode-for-uri
function.
An example of this type of link in HTML:
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[link](uuid=e177cf16-da6c-4c7d-a19c-09a201f5a2da&params=user%3Duser1&title=Details%20For%20user1){dashboard}">
Details For user1
</span>
</div>
Note
By using a pipeline with the appropriate XSLT it is possible to dynamically generate links in dashboard text panes that will be specific to the data being displayed.Data
A link can be created to open a sub-set of a source of data (i.e. part of a stream) for viewing.
The data can either be opened in a popup dialog (dialog
) or in another stroom tab (tab
).
It can also be display in preview
form (with formatting and syntax highlighting) or unaltered source
form.
Note
To make full use of data links for viewing raw data, you need to use the stroom:source()
XSLT Function to decorate an event with the details of the source location it derived from.
The format for a data link is as follows:
[Link Text](id=<STREAM_ID>&partNo=<PART_NO>&recordNo=<RECORD_NO>&lineFrom=<LINE_FROM>&colFrom=<COL_FROM>&lineTo=<LINE_TO>&colTo=<COL_TO>&viewType=<VIEW_TYPE>&displayType=<DISPLAY_TYPE>){data}
Stroom deals in two main types of stream, segmented and non-segmented (see Streams).
Data in a non-segmented (i.e. raw) stream is identified by an id
, a partNo
and optionally line and column positions to define the sub-set of that stream part to display.
Data in a segmented (i.e. cooked) stream is identified by an id
, a recordNo
and optionally line and column positions to define the sub-set of that record (i.e. event) within that stream.
The parameters for data links are:
id
- The stream ID.partNo
- The part number of the stream (one based). Always1
for segmented (cooked) streams.recordNo
- The record number within a segmented stream (optional). Not applicable for non-segmented streams so usenull()
instead.lineFrom
- The line number of the start of the sub-set of data (optional, one based).colFrom
- The column number of the start of the sub-set of data (optional, one based).lineTo
- The line number of the end of the sub-set of data (optional, one based).colTo
- The column number of the end of the sub-set of data (optional, one based).viewType
- The type of view of the data (optional, defaults topreview
):preview
: Display the data as a formatted preview of a limited portion of the data.source
: Display the un-formatted data in its original form with the ability to navigate around all of the data source.
displayType
- The way of displaying the data (optional, defaults todialog
):dialog
: Open as a modal popup dialog.tab
: Open as a top level tab within the Stroom browser tab.
In preview
mode the line and column positions will limit the data displayed to the specified selection.
In source
mode the line and column positions define a highlight block of text within the part/record.
Warning
The displayType
value tab
is not supported if the dashboard is viewed via a Direct URL.
This is because a direct URL displays only the dashboard without Stroom’s top level tab bar so it is not possible to open it as a top level tab.
An example of this type of link in HTML:
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[link](id=1822&partNo=1&recordNo=1){data}">
Show Source</span>
</div>
View Type
The additional parameter viewType
can be used to switch the data view mode from preview
(default) to source
.
In preview mode the optional parameters lineFrom
, colFrom
, lineTo
, colTo
can be used to limit the portion of the data that is displayed.
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[link](id=1822&partNo=1&recordNo=1&viewType=preview&lineFrom=1&colFrom=1&lineTo=10&colTo=8){data}">
Show Source Preview
</span>
</div>
In source mode the optional parameters lineFrom
, colFrom
, lineTo
, colTo
can be used to highlight a portion of the data that is displayed.
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[link](id=1822&partNo=1&recordNo=1&viewType=source&lineFrom=1&colFrom=1&lineTo=10&colTo=8){data}">
Show Source
</span>
</div>
Display Type
Choose whether to display data in a dialog
(default) or a Stroom tab
.
Stepping
A stepping link can be used to launch the data stepping feature with the specified data. The format for a stepping link is as follows:
[Link Text](id=<STREAM_ID>&partNo=<PART_NO>&recordNo=<RECORD_NO>){stepping}
The parameters for stepping links are as follows:
- id - The id of the stream to step.
- partNo - The sub part no within the stream to step (usually 1).
- recordNo - The record or event number within the stream to step.
An example of this type of link in HTML:
<div style="padding: 5px;">
<span style="text-decoration:underline;color:blue;cursor:pointer"
link="[link](id=1822&partNo=1&recordNo=1){stepping}">
Step Source</span>
</div>
Annotation
A link can be used to edit or create annotations. To view or edit an existing annotation the id must be known or one can be found using a stream and event id. If all parameters are specified an annotation will either be created or edited depending on whether it exists or not. The format for an annotation link is as follows:
[Link Text](annotationId=<ANNOTATION_ID>&streamId=<STREAM_ID>&eventId=<EVENT_ID>&title=<TITLE>&subject=<SUBJECT>&status=<STATUS>&assignedTo=<ASSIGNED_TO>&comment=<COMMENT>){annotation}
The parameters for annotation links are as follows:
- annotationId - The optional existing id of an annotation if one already exists.
- streamId - An optional stream id to link to a newly created annotation, or used to lookup an existing annotation if no annotation id is provided.
- eventId - An optional event id to link to a newly created annotation, or used to lookup an existing annotation if no annotation id is provided.
- title - An optional default title to give the annotation if a new one is created.
- subject - An optional default subject to give the annotation if a new one is created.
- status - An optional default status to give the annotation if a new one is created.
- assignedTo - An optional initial assignedTo value to give the annotation if a new one is created.
- comment - An optional initial comment to give the annotation if a new one is created.
3 - Direct URLs
It is possible to navigate directly to a specific Stroom dashboard using a direct URL. This can be useful when you have a dashboard that needs to be viewed by users that would otherwise not be using the Stroom user interface.
URL format
The format for the URL is as follows:
https://<HOST>/stroom/dashboard?type=Dashboard&uuid=<DASHBOARD UUID>[&title=<DASHBOARD TITLE>][¶ms=<DASHBOARD PARAMETERS>]
Example:
https://localhost/stroom/dashboard?type=Dashboard&uuid=c7c6b03c-5d47-4b8b-b84e-e4dfc6c84a09&title=My%20Dash¶ms=userId%3DFred%20Bloggs
Host and path
The host and path are typically https://<HOST>/stroom/dashboard
where <HOST>
is the hostname/IP for Stroom.
type
type
is a required parameter and must always be Dashboard
since we are opening a dashboard.
uuid
uuid
is a required parameter where <DASHBOARD UUID>
is the UUID for the dashboard you want a direct URL to, e.g. uuid=c7c6b03c-5d47-4b8b-b84e-e4dfc6c84a09
The UUID for the dashboard that you want to link to can be found by right clicking on the dashboard icon in the explorer tree and selecting Info.
The Info dialog will display something like this and the UUID can be copied from it:
DB ID: 4
UUID: c7c6b03c-5d47-4b8b-b84e-e4dfc6c84a09
Type: Dashboard
Name: Stroom Family App Events Dashboard
Created By: INTERNAL
Created On: 2018-12-10T06:33:03.275Z
Updated By: admin
Updated On: 2018-12-10T07:47:06.841Z
title (Optional)
title
is an optional URL parameter where <DASHBOARD TITLE>
allows the specification of a specific title for the opened dashboard instead of the default dashboard name.
The inclusion of ${name}
in the title allows the default dashboard name to be used and appended with other values, e.g. 'title=${name}%20-%20' + param.name
params (Optional)
params
is an optional URL parameter where <DASHBOARD PARAMETERS>
includes any parameters that have been defined for the dashboard in any of the expressions, e.g. params=userId%3DFred%20Bloggs
Permissions
In order for as user to view a dashboard they will need the necessary permission on the various entities that make up the dashboard.
For a Lucene index query and associated table the following permissions will be required:
- Read permission on the Dashboard entity.
- Use permission on any Indexe entities being queried in the dashboard.
- Use permission on any Pipeline entities set as search extraction Pipelines in any of the dashboard’s tables.
- Use permission on any XSLT entities used by the above search extraction Pipeline entites.
- Use permission on any ancestor pipelines of any of the above search extraction Pipeline entites (if applicable).
- Use permission on any Feed entities that you want the user to be able to see data for.
For a SQL Statistics query and associated table the following permissions will be required:
- Read permission on the Dashboard entity.
- Use permission on the StatisticStore entity being queried.
For a visualisation the following permissions will be required:
- Read permission on any Visualiation entities used in the dashboard.
- Read permission on any Script entities used by the above Visualiation entities.
- Read permission on any Script entities used by the above Script entities.