This is the multi-page printable view of this section. Click here to print.
Data Sources
- 1: Lucene Index Data Source
- 2: Statistics
- 3: Elasticsearch
- 4: Data Connections
- 4.1: JDBC Data Connections
- 4.2: Amazon Athena Data Connections
- 4.3: LDAP Data Connections
- 4.4: CSV and Excel Data Connections
- 5: Internal Data Sources
1 - Lucene Index Data Source
Stroom’s primary data source is its internal Lucene based search indexes. For details of how data is indexed see Lucene Indexes.
TODO
2 - Statistics
TODO
3 - Elasticsearch
Stroom can integrate with external Elasticsearch indexes to allow querying using Stroom’s various mechanisms for querying data sources. These indexes may have been populated using a Stroom pipeline (See here).
Searching Using a Stroom Dashboard
Searching an Elasticsearch index (or data stream) using a Stroom dashboard is conceptually similar to the process described in Dashboards.
Before you set the dashboard’s data source, you must first create an Elastic Index document to tell Stroom which index (or indices) you wish to query.
Create an Elastic Index Document
- Right-click a folder in the Stroom Explorer pane ().
- Select:
- Enter a name for the index document and click .
- Click next to the
Cluster configurationfield label. - In the dialog that appears, select the Elastic Cluster document where the index exists, and click .
- Enter the name of an index or data stream in
Index name or pattern. Data view (formerly known as index pattern) syntax is supported, which enables you to query multiple indices or data streams at once. For example:stroom-events-v1. - (Optional) Set
Search slices, which is the number of parallel workers that will query the index. For very large indices, increasing this value up to and including the number of shards can increase scroll performance, which will allow you to download results faster. - (Optional) Set
Search scroll size, which specifies the number of documents to return in each search response. Greater values generally increase efficiency. By default, Elasticsearch limits this number to10,000. - Click
Test Connection. A dialog will appear with the result, which will stateConnection Successif the connection was successful and the index pattern matched one or more indices. - Click .
Set the Elastic Index Document as the Dashboard Data Source
- Open or create a dashboard.
- Click in the
Querypanel. - Click next to the
Data Sourcefield label. - Select the Elastic Index document you created and click .
- Configure the query expression as explained in Dashboards. Note the tips for particular Elasticsearch field mapping data types.
- Configure the table.
Query Expression Tips
Certain Elasticsearch field mapping types support special syntax when used in a Stroom dashboard query expression.
To identify the field mapping type for a particular field:
- Click in the
Querypanel to add a new expression item. - Select the Elasticsearch field name in the drop-down list.
- Note the blue data type indicator to the far right of the row.
Common examples are:
keyword,textandnumber.
After you identify the field mapping type, move the mouse cursor over the mapping type indicator. A tooltip appears, explaining various types of queries you can perform against that particular field’s type.
Searching Multiple Indices
Using data view (index pattern) syntax, you can create powerful dashboards that query multiple indices at a time.
An example of this is where you have multiple indices covering different types of email systems.
Let’s assume these indices are named: stroom-exchange-v1, stroom-domino-v1 and stroom-mailu-v1.
There is a common set of fields across all three indices: @timestamp, Subject, Sender and Recipient.
You want to allow search across all indices at once, in effect creating a unified email dashboard.
You can achieve this by creating an Elastic Index document called (for example) Elastic-Email-Combined and setting the property Index name or pattern to: stroom-exchange-v1,stroom-domino-v1,stroom-mailu-v1.
Click and re-open the dashboard.
You’ll notice that the available fields are a union of the fields across all three indices.
You can now search by any of these - in particular, the fields common to all three.
4 - Data Connections
A
Data Connection
is one more kind of
data source
Data source
where, eval, group by, sort by and select.
Data Connections are read-only. Stroom never writes to the systems they connect to, and cannot join one data source to another.
Types
Each Data Connection has a Type, which decides where its data comes from and how it is queried.
| Type | Data | Queried with | Fields |
|---|---|---|---|
| JDBC | A database reached through a JDBC driver, e.g. MySQL or PostgreSQL. | SQL in each query’s sql clause. |
The columns the SQL returns. |
| Amazon Athena | Amazon Athena, reached through the AWS SDK. | SQL in each query’s sql clause. |
The columns the SQL returned when it last ran. |
| LDAP | An LDAP directory, e.g. OpenLDAP or Active Directory. | An LDAP search filter in each query’s sql clause. |
dn and the attributes listed in the document. |
| CSV | CSV text held in the document. | Stroom’s own clauses only. | The columns listed in the document. |
| Excel | An Excel .xlsx workbook held in the document. |
Stroom’s own clauses only. | The columns listed in the document. |
The pages for each type describe its settings. The rest of this page applies to them all.
Creating a Data Connection
- Right-click a folder in the Stroom Explorer pane ().
- Select:
- Enter a name for the Data Connection and click
.
Queries name it after
from, so a short name without spaces is easiest to type. - On the Settings tab, choose the Type and fill in the settings that appear below it.
- Click , or for CSV and Excel or , to check the settings.
- Click .
The settings of every type are kept when you change the Type, so you can switch back without losing them. Only the settings of the chosen type are checked and used.
Settings an administrator controls, such as which JDBC URLs are allowed, are checked when you save, so a mistake is reported straight away. They are checked again whenever the Data Connection connects, as an imported document is not checked on import.
Settings for Every Type
- Time Column (optional)
- A date column of the data, used to apply a query’s time range. See Time Range. Not used by Amazon Athena.
- Query Timeout (seconds)
- How long a query may run before it is stopped.
An administrator may set a lower ceiling.
Not used by CSV and Excel, which are read from the document.
Default:
60. - Max Rows
- The most rows a query may read.
A query with more uses the first ones and warns that the limit was reached.
An administrator may set a lower ceiling.
Default:
100000.
Querying a Data Connection
Name the Data Connection after from, as for any other data source.
For CSV and Excel that is all that is needed, as the data is held in the document, e.g.
from "Teams"
where on_call = true
sort by members desc
select team, members
JDBC, Amazon Athena and LDAP Data Connections also need the query to run in the external system: SQL for JDBC and Athena, or a search filter for LDAP.
It goes in a sql clause straight after from, as a string in triple double quotes (""").
A triple-quoted string is taken exactly as written, so it can span lines and hold " and \ without escaping, e.g.
from "Stroom DB"
sql """
select f.name as feed, t.name as type
from meta m
join meta_feed f on f.id = m.feed_id
join meta_type t on t.id = m.type_id
"""
eval streams = count()
group by feed, type
sort by streams desc
select feed, type, streams
The SQL or filter runs first, in the external system. Its rows then go through the rest of the query in Stroom, like the rows of any other data source. So keep the SQL or filter to what narrows the data, and let Stroom’s clauses do the rest, or do as much as the external system can do faster, as you prefer.
A sql clause is refused for a data source that does not take one, and a JDBC, Athena or LDAP Data Connection without one is refused with an example of the clause.
See Also
Fields
The fields of a query are the columns of the rows its data source gives:
- JDBC: the columns of the SQL. Stroom asks the database to describe the SQL without running it, so the fields are known as you type.
- Amazon Athena: the columns of the SQL when it last ran, as Athena cannot describe a query without running it and every run is billed. Until the SQL has run once, the field list is empty.
- LDAP:
dn, then each attribute listed in the document. - CSV and Excel: the columns listed in the document.
A field the query uses that the data does not have is empty, and the query warns about it.
A field used in where that is not a column is an error.
Parameters
The SQL or filter can take values from the query’s parameters, such as those of a dashboard, with a named placeholder: a colon followed by the parameter’s name, e.g. :feed.
from "Stroom DB"
sql """
select m.id, m.create_time
from meta m
join meta_feed f on f.id = m.feed_id
where f.name = :feed
"""
select id, create_time
A value is never pasted into the SQL or filter as text, so it cannot change it:
- JDBC binds it as a parameter of a prepared statement.
- Amazon Athena passes it as an execution parameter, written as a single SQL literal.
As Athena receives every value as text, compare it with a number by casting, e.g.
where id = cast(:id as bigint). - LDAP escapes it as a filter value, so
*)(uid=*is matched as text and finds nothing.
A placeholder with no parameter of its name is an error.
SQL must use named placeholders: a ? outside quotes is refused.
Time Range
A query’s time range can be applied in two ways.
In the SQL or filter, with the placeholders :from and :to, which take the start and end of the time range, e.g.
select * from events where event_time >= :from and event_time < :to
By default they are timestamps. A format in braces after the name changes them:
| Placeholder | Value |
|---|---|
:from |
A timestamp for JDBC and Athena, or an LDAP time (GeneralizedTime) for LDAP. |
:from{epochMillis} |
Milliseconds since 1970, as Stroom’s own tables hold times. |
:from{epochSeconds} |
Seconds since 1970. |
:from{yyyy-MM-dd} |
Text in the given date pattern, in UTC. |
In Stroom, on the document’s Time Column, when the SQL or filter has no :from or :to.
The SQL must return the column, and for LDAP, CSV and Excel it must be a Date column or attribute.
This reads every row the SQL or filter returns, so filtering in the SQL is faster on large data.
If neither applies, the time range is ignored and the query warns that it was.
Amazon Athena bills by the data each query scans, so an Athena query with a time range must use :from or :to in its SQL, and is refused otherwise.
Limits and Warnings
A query stops when it has read the document’s Max Rows or runs for its Query Timeout, whichever comes first. An administrator’s ceilings on both apply to every Data Connection.
Problems that do not stop a query are reported as warnings with its results, e.g.:
- The row limit was reached, so only the first rows were used.
- The time range was ignored.
- A field the query uses is not a column of the data.
- Values were not of their column’s type, so they are empty. The warning counts them and gives an example.
- For LDAP, a referral was not followed, or the directory’s own size or time limit ended the search.
Closing or stopping a query stops it in the external system too.
Dashboards
A Data Connection can be the data source of a dashboard’s Query panel. CSV and Excel need nothing more.
For JDBC, Amazon Athena and LDAP the query needs its sql clause, which the Query panel’s expression editor has no place for.
Write the query in a
Query
document instead, and show it on the dashboard with an Embedded Query panel.
A dashboard that refreshes automatically reruns the query each time, against the external system. The Minimum Refresh (minutes) setting of JDBC, Amazon Athena and LDAP Data Connections sets the shortest interval at which a dashboard may do so, to protect the system and, for Athena, the cost. A dashboard set to refresh more often is held to the minimum.
Analytics
Scheduled Query rules and
Report
documents can query a Data Connection.
Each run applies the rule’s time range to the time it runs for, using :from and :to or the Time Column as above.
Streaming and table builder rules run over events as Stroom processes them, through a View . A View cannot use a Data Connection, so these rules cannot either.
Permissions
To query a Data Connection a user needs Use permission on the document.
JDBC, LDAP and Amazon Athena Data Connections name a credential to connect with. The credential is used as the user running the query, who needs Use permission on the credential too. A credential that does not exist and one the user may not use give the same error, so the names of credentials cannot be discovered this way.
Testing a connection, and detecting the columns or attributes of the data, use the settings being edited with the credential they name. So they need permission to edit the document as well.
Warning
Stroom runs whatever SQL or filter a query gives, as the account of its credential. Use accounts that can only read the data Stroom should query: Stroom asks JDBC databases for read-only connections, but only the database, Athena workgroup or directory can enforce what an account may do.
Administration
An administrator controls what Data Connections may connect to with these properties, under stroom.dataConnection.
See Properties.
| Property | Default | Purpose |
|---|---|---|
allowedUrlPatterns |
None | Regular expressions a JDBC URL must match one of. With none, no JDBC connection is allowed. |
deniedConnectionProperties |
A list of MySQL and PostgreSQL properties | JDBC driver properties a Data Connection may not set, in its URL or its connection properties, because they can read local files, load classes or turn off read-only connections. |
driverDirectory |
None | A directory of extra JDBC driver jars, for databases other than MySQL and PostgreSQL, whose drivers Stroom ships. Needs a restart. |
allowedAthenaWorkGroups |
None | Regular expressions an Amazon Athena region/workgroup must match one of, e.g. ^eu-west-2/stroom-.*$. With none, no Athena connection is allowed. |
allowedAthenaOutputLocations |
None | Regular expressions an Athena output location must match one of. With none, Data Connections may not set one and the workgroup’s is used. |
allowDefaultAwsCredentials |
false |
Whether an Athena Data Connection with no credential may use Stroom’s own AWS identity. |
allowedLdapUrlPatterns |
None | Regular expressions an LDAP URL must match one of, e.g. ^ldaps://directory\.example\.org:636$. With none, no LDAP connection is allowed. |
allowPlainLdap |
false |
Whether an LDAP Data Connection may connect with plain ldap:// and no StartTLS, sending its password and results unencrypted. |
maxStoredDataSize |
5M (5 MiB) |
The most CSV or Excel data a Data Connection may hold. |
maxQueryTimeout |
PT10M |
The longest query timeout a Data Connection may set. |
maxRowsLimit |
1000000 |
The highest row limit a Data Connection may set. |
maxPoolSizeLimit |
20 |
The largest JDBC connection pool a Data Connection may set. |
connectionPoolCache |
100 pools, closed after 10 minutes unused | The JDBC connection pools, one per Data Connection. |
fieldCache |
1000 entries for 10 minutes | The columns of each query’s SQL, so editors can list fields without asking the database each time. |
tableCache |
10 entries, for 10 minutes unused | The rows read from the CSV or Excel data of each Data Connection. |
With the defaults, no JDBC, Athena or LDAP connection is allowed until an administrator allows one. CSV and Excel Data Connections need no setting.
Example Pack
The Stroom repository holds an import pack of example Data Connections and queries, stroom-data-connection/DataConnection-Examples.zip, for trying them out in a development or test Stroom.
Import it with:
It imports a Data Connection Examples folder holding:
- Stroom DB, a JDBC Data Connection pointed at Stroom’s own MySQL database, with queries of its nodes, streams and processor tasks.
- Teams, a CSV Data Connection, and Bank Holidays, an Excel one, each with a query. They need no set-up.
- People, a CSV Data Connection, and ten Join - … queries that join it to Teams and Bank Holidays: a left join, a semi join with a condition on the joined source, an anti join, a join to a bracketed grouped query, a join on a date,
where exists,where not exists,where ... in, a right join and a full outer join. They need no set-up either, see Joins. - Directory, an LDAP Data Connection, with queries of the people in a directory.
The Documentation tab of each JDBC and LDAP Data Connection gives its set-up steps. Change its URL to your own database or directory first, as the queries will otherwise read a different one, or none.
Warning
Reading Stroom’s own meta table directly bypasses Stroom’s feed permissions, so do not set up the Stroom DB example on a production Stroom.
4.1 - JDBC Data Connections
A JDBC
Data Connection
connects to a database through a JDBC driver.
Each query gives the SQL to run in a sql clause, and the columns of its result become the query’s fields.
Stroom ships the MySQL and PostgreSQL drivers.
An administrator can add drivers for other databases by putting their jars in the directory named by the stroom.dataConnection.driverDirectory property.
Settings
- JDBC URL
- The JDBC URL of the database, e.g.
jdbc:mysql://reporting-db:3306/reports. It must match one of the patterns an administrator has allowed in thestroom.dataConnection.allowedUrlPatternsproperty. Do not put a user name or password in it; choose a credential instead. - Credential
- The Username / Password credential to connect with. You need Use permission on it, as does anyone who queries this Data Connection.
- Connection Properties
- Extra JDBC driver properties, one
name=valueper line. For MySQL, adduseCursorFetch=trueso large results are read in batches of the fetch size rather than all at once. - Max Pool Size
- The most connections Stroom keeps open to this database at once.
An administrator may set a lower ceiling.
Default:
5. - Fetch Size
- How many rows are fetched from the database in each round trip.
0uses the driver’s own default. Default:1000. - Minimum Refresh (minutes)
- The shortest interval at which a dashboard may rerun a query of this Data Connection automatically, to limit the load on the database.
0sets no minimum beyond the dashboard’s own 10 seconds. Default:0.
The Time Column, Query Timeout and Max Rows settings are described in Settings for Every Type.
connects with the settings as they stand and reports the database and driver it reached, and the user it connected as.
Writing the SQL
The SQL is a single statement that returns rows, given in a triple-quoted sql clause, e.g.
from "Reports DB"
sql """
select name, team, joined
from staff
where joined >= :from and joined < :to
"""
where team = "Platform"
select name, joined
- A
;is only allowed at the end, so a query cannot run a second statement. - Use named placeholders such as
:teamfor values, not?, which is refused outside quotes. See Parameters and Time Range. - Give each column the name you want as its field, with
asif needed, e.g.count(*) as streams. A field matches a column of the same name, or failing that a column whose name differs only in case, as some databases change the case of names that are not quoted.
Stroom asks the database to describe the SQL without running it, so the fields are listed in the query editor as you write the SQL.
Column Types
Each column is read as a Stroom field type, from the type the driver reports:
| Database type | Field type |
|---|---|
TINYINT, SMALLINT, INTEGER |
Integer |
BIGINT |
Long |
DECIMAL and NUMERIC with no fraction and up to 18 digits |
Long |
REAL, FLOAT |
Float |
DOUBLE, and other DECIMAL and NUMERIC |
Double |
BOOLEAN, BIT |
Boolean |
DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE |
Date |
| Anything else | Text |
A date or timestamp with no time zone is taken as UTC.
An unsigned BIGINT too large for a Long is read as a Double.
Stroom’s own tables hold times as milliseconds since 1970 in BIGINT columns.
To read them as dates, convert them in the SQL, e.g. from_unixtime(create_time / 1000) in MySQL, and compare them with the time range using :from{epochMillis} and :to{epochMillis}.
Security
Stroom asks for read-only connections, turning off auto-commit so that PostgreSQL connections are read-only too. Only the database can enforce what an account may do, so the credential should be for an account that can only read the tables Stroom should query.
An administrator’s controls are checked when the Data Connection is saved and again whenever it connects:
- The URL must match one of the
stroom.dataConnection.allowedUrlPatternspatterns. - Embedded databases (
jdbc:h2:,jdbc:hsqldb:,jdbc:derby:andjdbc:sqlite:) are refused, as they read files on the Stroom server. - Driver properties that can read local files, load classes or turn off read-only connections are refused, whether in the URL or the connection properties.
The list is the
stroom.dataConnection.deniedConnectionPropertiesproperty. For MySQL and PostgreSQL the URL is read by the driver’s own parser, so a property cannot be hidden in it. The URLs of other databases cannot contain%or(; set their properties as connection properties instead. - A user name or password in the URL or connection properties is refused, so a secret is never stored in the document.
4.2 - Amazon Athena Data Connections
An Amazon Athena
Data Connection
runs SQL in
Amazon Athena
through the AWS SDK.
Each query gives the SQL to run in a sql clause, and the columns of its result become the query’s fields.
Athena bills by the data each query scans, so several settings and rules here exist to keep the cost in check.
Settings
- AWS Region
- The AWS region of the Athena workgroup, e.g.
eu-west-2. - Workgroup
- The Athena workgroup queries run in.
The region and workgroup, written
region/workgroup, must match one of the patterns an administrator has allowed in thestroom.dataConnection.allowedAthenaWorkGroupsproperty. The workgroup’s per-query data scan limit is the control on cost. Default:primary. - Data Catalog
- The data catalog queries run in.
Default:
AwsDataCatalog. - Database
- The database queries run in.
Default:
default. - Output Location (optional)
- The S3 URI query results are written to, e.g.
s3://my-bucket/athena/. Leave it empty to use the workgroup’s. It must match one of the patterns an administrator has allowed in thestroom.dataConnection.allowedAthenaOutputLocationsproperty; with none, it must be left empty. - Credential
- The AWS Access Key credential to query with.
You need Use permission on it, as does anyone who queries this Data Connection.
With none, Stroom’s own AWS identity is used, but only if an administrator has turned on the
stroom.dataConnection.allowDefaultAwsCredentialsproperty. - Result Reuse (minutes)
- How old a result of the same query may be and still be reused instead of running the query again.
Athena bills every run, so this saves cost when the same query is run again.
0never reuses a result. Default:0. - Minimum Refresh (minutes)
- The shortest interval at which a dashboard may rerun a query of this Data Connection automatically.
Result reuse rarely helps a dashboard, as its time range changes on every refresh, and many refreshes also use up the account’s limit on Athena queries running at once.
0sets no minimum beyond the dashboard’s own 10 seconds. Default:5. - Max Data Scanned (MB)
- The most data, in MB, a query may scan before Stroom stops it.
Stroom checks while the query runs, so a query may pass the limit by what it scans between two checks.
The workgroup’s own per-query data scan limit is the one Athena enforces exactly, so set that too.
0sets no limit beyond the workgroup’s. Default:0.
The Query Timeout and Max Rows settings are described in Settings for Every Type. Athena takes the time range in its SQL, so it has no time column.
runs no query, as every query is billed. It looks up the workgroup and the database, which checks the credential, region, workgroup and database. It reports the workgroup’s data scan limit and result location, or that none is set, and whether the workgroup enforces its own settings.
Writing the SQL
The SQL is a single statement that returns rows, given in a triple-quoted sql clause, e.g.
from "Events"
sql """
select event_time, user_name, action
from sign_ins
where event_time >= :from and event_time < :to
and outcome = 'FAILED'
"""
eval failures = count()
group by user_name
sort by failures desc
select user_name, failures
- Only SQL that starts with
SELECT,WITH,VALUES,SHOWorDESCRIBEis run, as an Athena connection cannot be made read-only. That refusesCREATE TABLE AS,INSERTandUNLOAD. - A
;is only allowed at the end, so a query cannot run a second statement. - A query with a time range must use
:fromor:toin its SQL, and is refused otherwise. Filtering in Stroom after Athena had scanned everything would cost money for nothing. - Athena receives every parameter as text, written as a single SQL literal.
To compare one with a number, cast it, e.g.
where id = cast(:id as bigint).
See Parameters and Time Range.
Fields
Athena cannot describe a query without running it, and every run is billed. So the fields of a query are only known once its SQL has run; until then the field list is empty. After a run, the fields are remembered for a while, so the query editor can list them.
Cost
Each run reports the data Athena scanned with its results.
A query is stopped in Athena, not just in Stroom, when it is cancelled, when it reaches the query timeout or the Max Data Scanned limit, or when Stroom fails after starting it.
Warning
Set a per-query data scan limit on every workgroup Stroom may use. It is the only limit Athena enforces exactly, whatever a Data Connection’s settings.
Security
- The region and workgroup must match one of the
stroom.dataConnection.allowedAthenaWorkGroupspatterns. - An output location must match one of the
stroom.dataConnection.allowedAthenaOutputLocationspatterns. Every query writes its full result there, with the AWS identity of the user running it. - A Data Connection must name an AWS access key credential, unless
stroom.dataConnection.allowDefaultAwsCredentialsis on. Otherwise any user who can create a document could query whatever Stroom’s own AWS identity can read. - Use AWS identities that can only read the tables Stroom should query. Federated queries pass SQL to connectors that Stroom cannot see into, so their accounts should only be able to read too.
4.3 - LDAP Data Connections
An LDAP
Data Connection
searches an LDAP directory.
Each query gives an LDAP search filter in a sql clause, and each entry it finds becomes a row.
The fields are dn and the attributes listed in the document.
Settings
- LDAP URL
- The directory’s URL: its scheme, host and port only, e.g.
ldaps://directory.example.org:636. It must match one of the patterns an administrator has allowed in thestroom.dataConnection.allowedLdapUrlPatternsproperty. A URL that also gives a base DN, attributes, scope or filter is refused; set those in their own places. - Use StartTLS
- Whether to start TLS on an
ldap://connection before binding, so the password and results are encrypted. Anldaps://connection is always encrypted. Plainldap://without StartTLS can only be used if an administrator turns on thestroom.dataConnection.allowPlainLdapproperty. Default: off. - Credential
- The Username / Password credential to bind with.
Its username is the full bind DN, e.g.
cn=stroom-reader,ou=Services,dc=example,dc=org. You need Use permission on it, as does anyone who queries this Data Connection. Anonymous binds are not allowed, so a credential is required, and it must have a password. - Base DN
- Where searches start, e.g.
ou=People,dc=example,dc=org. Queries cannot search outside it. - Scope
- How far below the base DN searches reach: the base entry only, the entries directly below it, or the whole subtree. Default: the whole subtree.
- Page Size
- How many entries are fetched in each page of results.
Default:
500. - Minimum Refresh (minutes)
- The shortest interval at which a dashboard may rerun a query of this Data Connection automatically, to limit the load on the directory.
0sets no minimum beyond the dashboard’s own 10 seconds. Default:0. - Attributes
- The attributes read from each entry, each with a type. See Attributes.
The Time Column, Query Timeout and Max Rows settings are described in Settings for Every Type.
connects, starts TLS if set, binds and reads the base DN’s entry. It reports the directory’s vendor, and whether the directory supports paged results.
Attributes
The fields of a query are dn, which every entry has, then each attribute in the Attributes table, in order.
An attribute an entry does not have is empty.
reads the first 100 entries below the base DN and adds the attributes they have to the table, with the type their values suggest.
Attributes already in the table stay, in their place and with their type, so a type you chose survives detecting the attributes again.
It also asks for createTimestamp and modifyTimestamp, which most directories keep but only return when asked for by name.
Directories return some attributes only when asked for by name, such as operational attributes, and an attribute may only be on later entries. Add these to the table by name, and remove the ones you do not need, as each attribute is fetched from the directory for every entry.
Each attribute is read as its type:
| Type | Reads |
|---|---|
| Text | Any attribute. An attribute with several values, such as memberOf, gives them all, joined by ; . Binary values, such as objectGUID, are given in base64. |
| Long, Double | A number. |
| Boolean | TRUE or FALSE, as LDAP writes them, in any case. |
| Date | An LDAP time (GeneralizedTime), such as createTimestamp or whenCreated, or an Active Directory FILETIME number, such as lastLogonTimestamp or pwdLastSet. A FILETIME of 0, or the largest possible value, means no time and is empty. |
An attribute with more than one value, or a binary value, can only be read as Text. A value that is not of its attribute’s type is empty, and the query warns about it. Detect Attributes suggests Date only for LDAP times, so set FILETIME attributes to Date yourself.
Writing the Filter
The filter is a standard LDAP search filter, given in a triple-quoted sql clause, e.g.
from "Directory"
sql """
(&(objectClass=person)(departmentNumber=:department))
"""
sort by cn
select cn, uid, mail
The brackets around a filter may be left off, e.g. objectClass=person.
A placeholder takes the value of the query parameter of its name, and :from and :to take the time range as LDAP times, e.g. (modifyTimestamp>=:from).
See Parameters and Time Range.
Each value is escaped as an LDAP filter value, so it can only ever be matched and never change the filter.
- A colon also appears in extensible match filters, such as
(cn:caseExactMatch:=Fred), and in values such as times and URLs. So a colon only starts a placeholder where a value starts, straight after=,~=,>=or<=, or after a*wildcard. A value that must start with a colon followed by a letter writes the colon as\3a. - Values are escaped for the filter, not for a DN.
So in a DN-valued filter such as
(member=uid=:user,ou=People,dc=example,dc=org), a parameter holding a comma could compare a different DN, though never change the filter. Give the whole DN as one parameter instead, e.g.(member=:memberDn).
Searching
- Entries are fetched a page at a time with the simple paged results control, so a search can read more entries than the directory returns at once. The control is not marked critical, so a directory without it still answers, within its own size limit.
- The search stops at the Data Connection’s Max Rows.
- If the directory’s own size or time limit for the bind account ends a search, the query keeps the entries read so far and warns. Narrow the filter, or ask the directory’s administrator to raise the limit.
- Referrals to other servers are not followed, as the allowed LDAP URLs may not include them. The query warns how many there were. Search those servers with Data Connections of their own.
Security
- The URL must match one of the
stroom.dataConnection.allowedLdapUrlPatternspatterns. - The connection must be encrypted, with
ldaps://or StartTLS, unlessstroom.dataConnection.allowPlainLdapis on. Plain LDAP sends the bind password and every result unencrypted, so only use it for test directories. - The directory’s certificate must be trusted by Stroom’s Java trust store and name the host in the URL.
- Directories hold personal data, so use a bind account the directory lets read only the entries and attributes Stroom needs.
- Stroom’s LDAP client never turns what a directory returns into Java objects, so a directory cannot make Stroom load code.
Active Directory
Active Directory names some attributes differently from the standard inetOrgPerson ones, e.g.:
| Standard | Active Directory |
|---|---|
uid |
sAMAccountName |
departmentNumber |
department |
createTimestamp |
whenCreated |
modifyTimestamp |
whenChanged |
Its global catalog, on ports 3268 and 3269, can search a whole forest without referrals.
Times such as lastLogonTimestamp, pwdLastSet and accountExpires are FILETIME numbers: set their type to Date to read them as dates.
4.4 - CSV and Excel Data Connections
A CSV or Excel
Data Connection
holds its data in the document itself, so it needs no connection and no credential.
It suits small lookup tables and reference lists, such as teams, sites or holidays, that queries and dashboards can use alongside Stroom’s own data.
Bulk data belongs in a
Feed
Feed
The data is queried with Stroom’s own clauses alone, so a query has no sql clause, e.g.
from "Bank Holidays"
where region = "All" or region = "Scotland"
sort by date
select date, holiday
The data is held, exported and imported with the document.
An export keeps it in a file of its own beside the document’s JSON: the CSV as text, in a .csv file, and the workbook as the original .xlsx file.
An administrator sets the most data a Data Connection may hold with the stroom.dataConnection.maxStoredDataSize property, 5M (5 MiB) by default.
Saving more is refused.
Columns
The fields of a query are the columns in the document’s Columns table, in the order their values appear in each row. Each column has a name, which becomes the field name, and a type, which its values are read as:
| Type | Values |
|---|---|
| Text | Anything, kept as it is. |
| Long | Whole numbers. |
| Double | Numbers that may have a fraction. |
| Date | Dates and times in ISO 8601 with a four-digit year, e.g. 2026-11-12 or 2026-11-12T09:30:00Z. A space may stand for the T. A time with no zone is taken as UTC; a zone is Z or an offset such as +01:00, +0100 or +01. |
| Boolean | true or false, in any case. |
A value that is not of its column’s type is empty, and the query warns about it, giving the number of such values and an example.
reads the first 1,000 rows and fills in the table:
- Each column is named from the header row, if there is one.
A column with no name in the header, or with no header row, is named
column1,column2and so on, and a repeated name has a suffix added, as each column needs a field name of its own. Names that differ only in case, such asTeamandteam, count as repeated, as fields are matched without regard to case. - Each column’s type is guessed from its values: the narrowest of Long, Double, Date and Boolean that all of them are, or else Text.
Numbers that would lose something as a number stay Text, such as codes with leading zeros, e.g.
0123, and whole numbers too big for a Long, such as long identifiers. - A column already in the table keeps the type you chose for it, even if the case of its name in the header has changed, so you can detect the columns again after changing the data.
If the header row no longer matches the columns in the table, because the data changed after they were detected, a query warns that values may be under the wrong fields. Detect the columns again.
CSV
- Delimiter
- The character between the values of each row: comma, semicolon, tab or pipe. Default: comma.
- First Row Is A Header
- Whether the first row holds the column names. Default: on.
- CSV
- The data.
Paste it in, or click
to read a file from your computer, which then detects the columns.
Values are read as CSV, so a value holding the delimiter, a quote or a line break is quoted in
"double quotes, with any"inside written twice.
Changing the delimiter or the header setting detects the columns again.
reads all of the CSV and reports how many rows and columns it has, and any values that are not of their column’s type.
Excel
- Workbook
- The Excel workbook.
Choose an
.xlsxfile: it is uploaded straight away, which detects the columns, and stored with the document when you save. Older.xlsworkbooks cannot be read; save them as.xlsxin Excel first. downloads the stored workbook, e.g. to edit it in Excel and upload it again. removes it when you save. - Sheet (optional)
- The name of the sheet to read. Leave it empty to read the first sheet.
- First Row Is A Header
- Whether the first row with values holds the column names. Default: on.
Excel values are read as Excel worked them out:
- Numbers are read as plain numbers, whatever their format in Excel, e.g.
1234.5for a cell shown as£1,234.50. - Dates are read as dates, including in workbooks that count dates from 1904, as older Mac versions of Excel did.
- Formulas are read as the value Excel last worked out for them; Stroom does not work them out again.
reads all of the sheet and reports how many rows and columns it has, and any values that are not of their column’s type.
The browser never holds the workbook: it is uploaded to Stroom, and downloaded only when you ask.
Time Range and Other Settings
If the document names a Time Column, which must be a Date column, a query’s time range filters the rows on it. With none, the time range is ignored, and the query warns that it was.
The data only changes when the document does, so CSV and Excel Data Connections have no query timeout and no minimum refresh. The rows read are cached for each version of the document, so a dashboard that refreshes does not read the data again.
5 - Internal Data Sources
Stroom provides a number of built in data sources for querying the inner workings of stroom.
These data sources do not have a corresponding
Document
Document
These data sources appear as children of the root folder when selecting a data source in a Dashboard , View . They are also available in the list of data sources when editing a Query .
Analytics
TODO
Annotations
Annotations are a means of annotating search results with additional information and for assigning those annotations to users. The Annotations data source allows you to query the annotations that have been created.
| Field | Type | Description |
|---|---|---|
annotation:Id |
Long | Annotation unique identifier. |
annotation:CreatedOn |
Date | Date created. |
annotation:CreatedBy |
String | Username of the user that created the annotation. |
annotation:UpdatedOn |
Date | Date last updated. |
annotation:UpdatedBy |
String | Username of the user that last updated the annotation. |
annotation:Title |
String | |
annotation:Subject |
String | |
annotation:AssignedTo |
String | Username the annotation is assigned to. |
annotation:Comment |
String | Any comments on the annotation. |
annotation:History |
String | History of changes to the annotation. |
Dual
The Dual data source is one with a single field that always returns one row with the same value.
This data source can be useful for testing expression functions.
It can also be useful when combined with an extraction pipeline that uses the stroom:http-call() XSLT function in order to make a single HTTP call using Dashboard parameter values.
| Field | Type | Description |
|---|---|---|
Dummy |
String | Always one row that has the value X |
Index Shards
Exposes the details of the index shards that make up Stroom’s Lucene based index. Each index is split up into one or more partitions and each partition is further divided into one or more shards. Each row represents one index shard.
| Field | Type | Description |
|---|---|---|
Node |
String | The name of the node that the index belongs to. |
Index |
String | The name of the index document. |
Index Name |
String | The name of the index document. |
Volume Path |
String | The file path for the index shard. |
Volume Group |
String | The name of the volume group the index is using. |
Partition |
String | The name of the partition that the shard is in. |
Doc Count |
Integer | The number of documents in the shard. |
File Size |
Long | The size of the shard on disk in bytes. |
Status |
String | The status of the shard (Closed, Open, Closing, Opening, New, Deleted, Corrupt). |
Last Commit |
Date | The time and date of the last commit to the shard. |
Meta Store
Exposes details of the streams held in Stroom’s
Stream
Stream
| Field | Type | Description |
|---|---|---|
Feed |
String | The name of the feed the stream belongs to. |
Pipeline |
String | The name of the pipeline that created the stream. [Optional] |
Pipeline Name |
String | The name of the pipeline that created the stream. [Optional] |
Status |
String | The status of the stream (Unlocked, Locked, Deleted). |
Type |
String | The
Stream Type
Stream Type
All Streams must have a Stream Type. The list of Stream Types is configured using the Property Click to see more details..., e.g. stroom.data.meta.metaTypes.Events, Raw Events, etc. |
Id |
Long | The unique ID (within this Stroom cluster) for the stream . |
Parent Id |
Long | The unique ID (within this Stroom cluster) for the parent stream, e.g. the Raw stream that spawned an Events stream. [Optional] |
Processor Id |
Long | The unique ID (within this Stroom cluster) for the processor that produced this stream. [Optional] |
Processor Filter Id |
Long | The unique ID (within this Stroom cluster) for the processor filter that produced this stream. [Optional] |
Processor Task Id |
Long | The unique ID (within this Stroom cluster) for the processor task that produced this stream. [Optional] |
Create Time |
Date | The time the stream was created. |
Effective Time |
Date | The time that the data in this stream is effective for. This is only used for reference data streams and is the time that the snapshot of reference data was captured. [Optional] |
Status Time |
Date | The time that the status was last changed. |
Duration |
Long | The time it took to process the stream in milliseconds. [Optional] |
Read Count |
Long | The number of records read in segmented streams. [Optional] |
Write Count |
Long | The number of records written in segmented streams. [Optional] |
Info Count |
Long | The number of INFO messages. |
Warning Count |
Long | The number of WARNING messages. |
Error Count |
Long | The number of ERROR messages. |
Fatal Error Count |
Long | The number of FATAL_ERROR messages. |
File Size |
Long | The compressed size of the stream on disk in bytes. |
Raw Size |
Long | The un-compressed size of the stream on disk in bytes. |
Processor Tasks
Exposes details of the tasks spawned by the processor filters. Each row represents one processor task.
| Field | Type | Description |
|---|---|---|
Create Time |
Date | The time the task was created. |
Create Time Ms |
Long | The time the task was created (milliseconds). |
Start Time |
Date | The time the task was executed. |
Start Time Ms |
Long | The time the task was executed (milliseconds). |
End Time |
Date | The time the task finished. |
End Time Ms |
Long | The time the task finished (milliseconds). |
Status Time |
Date | The time the status of the task was last updated. |
Status Time Ms |
Long | The time the status of the task was last updated (milliseconds). |
Meta Id |
Long | The unique ID (unique within this Stroom cluster) of the stream the task was for. |
Node |
String | The name of the node that the task was executed on. |
Pipeline |
String | The name of the pipeline that spawned the task. |
Pipeline Name |
String | The name of the pipeline that spawned the task. |
Processor Filter Id |
Long | The ID of the processor filter that spawned the task. |
Processor Filter Priority |
Integer | The priority of the processor filter when the task was executed. |
Processor Id |
Long | The unique ID (unique within this Stroom cluster) of the pipeline processor that spawned this task. |
Feed |
String | |
Status |
String | The status of the task (Created, Queued, Processing, Complete, Failed, Deleted). |
Task Id |
Long | The unique ID (unique within this Stroom cluster) of this task. |
Reference Data Store
Warning
Reference data is written to a persistent cache on storage local to the node. This data source exposes the data held in the store on the local node only. Given that most Stroom deployments are clustered and the UI nodes are typically not doing processing, this means the UI node will have no reference data.
Task Manager
This data source exposes the background tasks currently running across the Stroom cluster. Each row represents a single background server task.
Requires the Manage Tasks application permission.
| Field | Type | Description |
|---|---|---|
Node |
String | The name of the node that the task is running on. |
Name |
String | The name of the task. |
User |
String | The user name of the user that the task is running as. |
Submit Time |
Date | The time the task was submitted. |
Age |
Duration | The time the task has been running for. |
Info |
String | The latest information message from the task. |