This video demonstrates how to create a metadata rule in the OCS Portal.
A metadata rule is a user-defined stream name pattern where each part is assigned metadata.
Metadata rules capture any streams currently stored in an OCS namespace, as well as any
matching streams that are subsequently added to the namespace.
On the OCS portal home page, click here to display the menu and then click Sequential
Data Store under Data Management.
Next, click Streams and then select the namespace in which you intend to create the metadata
rule.
Review the streams in the namespace and copy the stream name that is the basis for your
metadata rule.
Click here to display the menu again.
Then, click Metadata Management under Data Management.
Select the namespace of the stream that is the basis for the metatdata pattern.
You must create your metadata rule in the same namespace as the streams it captures.
Click Add Metadata Rule to display the Select Stream page.
Paste the name of the stream here.
You can also enter the first few characters of the stream name followed by a wild card.
Here, we’re creating a metadata rule based on the stream name AUS.TK-37716.TEMP.
Select the AUS.TK-37716.TEMP stream and click Next to display the Create Pattern page.
Assign specific metadata parts to the delimited portions of the selected stream name.
Note that each of the streams matching the “AUS.TK-*” pattern provide multiple types
of measurements.
Here, a period delimits “AUS” and “TK,” the first two parts of the stream name.
A dash delimits “TK” and “37716,” and a period delimits “37716” and “TEMP”.
Each part of the stream name represents the following values:
AUS is the facility location and stands for Austin.
TK is the device type and stands for tank.
37716 is a specific device TEMP is the data provided by the stream and
stands for temperature.
Click the delimiter above each part of the stream name to assign metadata to each part
of the stream name: Assign AUS, the facility location, string
literal.
Only stream names that start with the string “AUS” match this pattern.
Assign TK, the device type identifier, string literal.
Streams with “TK” in the second part of the stream name result in a match.
Assign 37716, the device identifier, wildcard.
This matches streams that show any value in the third part of the stream name.
TEMP is the data provided by the example stream.
Assign TEMP metadata, expressed as a key-value pair.
Selecting metadata requires a key definition, in this case “Measurement,” because the
streams that match the rule provide different measurements.
This rule provides a way to search for every stream that contains measurement data for
every TK device in the AUS facility location.
Click Next to display the Define Mappings page.
On the Define Mappings page, there are two choices for each key-value pair.
To display the raw stream data for the Measurement metadata key, select Copy Values.
The measurement value is displayed for every stream captured by the new metadata rule.
To specify a user-friendly label for the measurement data, select Map Values.
Click Generate Mappings to generate the mappings for the streams that match the rule.
Enter user-friendly metadata values for each stream mapping.
Click Next to create the defined mappings.
On the Preview and Run page, each label defined in the mapping is displayed in the Measurement
column.
The assigned metadata key, “Measurement,” is the heading name for the column.
Enter a name and description for the new metadata rule.
Click Save & Execute to save the metadata rule for the selected namespace.
The metadata rule also captures any matching streams that are subsequently added to the
namespace.
The new metadata rule is listed on the Metadata Rules page.
Click the name of the rule you just created.
In the Details pane, copy the stream name pattern of the new metadata rule.
Click on the menu icon and select Sequential Data Store under Data Management.
Select Streams and paste the stream name pattern into the Search field.
The streams captured by the new metadata rule are displayed.