OPAL Verbs

Verbs process sets of rows. This page lists every OPAL verb grouped by category.

Aggregate Verbs

Aggregate verbs establish an aggregate context: multiple input rows generate fewer, summarizing, output rows.

VerbDescription
aggregateAggregates metrics across tag dimensions.
alignAlign raw metrics onto a time grid (defined by the input period) by aggregating nearby data points together.
bucketizeAlias of timechart.
dedupdedup collapses all rows in a dataset with the same timestamp and identical values in specified columns to one row.
distinctAlias of dedup.
fillFills all the missing data in the query window or fills the missing data ahead of the last bucket by the given frame.
histogramGenerate an approximated equi-width histogram for the selected expression.
make_referenceCreate a reference table by aggregating data over time.
make_sessionGroup events or intervals that are close to each other into sessions, and calculate aggregations over each session.
makesessionDeprecated alias of make_session.
merge_eventsMerge consecutive events into new events based on merge conditions.
pivotThe pivot verb rotates a table by transforming rows into columns.
reaggregateDeprecated alias of aggregate.
rollupRollup raw metrics into aligned metrics.
statsbyCalculate statistics of columns with aggregate functions, based on (optional) grouping columns.
timechartBin (in time) and aggregate point or interval table columns through time, based on (optional) grouping columns.
timestatsAggregate columns at every point in time, based on (optional) grouping columns.
unpivotThe unpivot verb rotates a table by transforming a list of columns into rows.

Filter Verbs

Filter verbs select particular rows from the input row set, emitting the matches as output.

VerbDescription
alwaysWhen the verb input is a Resource dataset, always selects all resources that matched the predicate at all times.
bottomkSelects all data for each of the bottom k ranked groups.
everWhen the verb input is a Resource dataset, ever selects all resources that at some point matched the predicate.
filterExclude rows from the input dataset that do not match the given predicate expression.
filter_lastExclude rows from the input dataset that do not match the given predicate expression.
limitSelect the first count rows based on the current ordering of the input and filter out the rest.
neverWhen the verb input is a Resource dataset, never selects all resources that at no point matched the predicate.
topkSelects all data for each of the top k ranked groups.

Join Verbs

Join verbs link multiple datasets together. They may generate more, fewer, or the same number of output rows as input rows, depending on the join condition and verb.

Join cost considerations

Joins are a powerful tool that can increase the amount of data collected and credits consumed. In order to keep your queries efficient, it is useful to check that the join being used is the most efficient one that will work for your use case.

From most expensive to least expensive:

  • lookup or leftjoin between two Resource or Interval datasets
    • This uses an interval overlapping band-join and an additional temporal left outer join. Prefer join to lookup in this case.
  • join between two Resource or Interval datasets
    • This only uses an interval overlapping band-join
  • lookup, leftjoin, or join between one Event and one Resource or Interval dataset (with or without window functions)
  • join or leftjoin between two Event datasets with window functions
    • These all use a point-in-interval band-join
  • lookup, leftjoin, or join between two Event datasets (without window functions), or between one Table and another dataset.
    • These use simple relational joins
VerbDescription
existsReturn the rows from the default dataset that have a match anywhere in the query time window.
followReturn the rows from the additional joined dataset that have a match anywhere in the query time window.
follow_notReturn the rows from the joined dataset that do not have a match anywhere in the query time window.
fulljoinTemporal full join, adding new columns in the output dataset.
joinTemporal inner join, adding new columns in the output dataset.
leftjoinTemporal left join, adding new columns in the output dataset.
lookupFind matching rows in a dataset, retrieving fields and adding them to the output dataset as new columns.
lookup_ip_infoUsing a value or column of type IPv4, look up corresponding fields associated with the IP address.
merge_eventDeprecated alias of update_resource.
mergeeventDeprecated alias of update_resource.
not_existsReturn the rows from the default dataset that do not have a match anywhere in the query time window.
surroundingOuter joins datasets by matching row time to a specified frame as well as column values.
unionCreate a new dataset consisting of the rows from the main input and each of the arguments.
update_resourceAugments the input Resource dataset using events from another dataset.

Metadata Verbs

Metadata verbs modify the metadata of the dataset and the columns in the dataset, rather than directly acting on the data itself.

Certain metadata verbs may affect how the dataset is presented, such as whether column links are shown, or whether data is packed.

VerbDescription
add_keyAdd a candidate key to the output.
addfkDeprecated alias of set_link.
addkeyDeprecated alias of add_key.
addmetricDeprecated alias of set_metric.
changelogDeprecated alias of make_event.
colenumDeprecated alias of set_col_enum.
colimmutableDeprecated alias of set_col_immutable.
colshowDeprecated alias of set_col_visible.
drop_interfaceRemoves one or more interface implementations from the current dataset.
droptimeDeprecated alias of make_table.
fkdropDeprecated alias of unset_link.
interfaceMap fields of this dataset to a pre-defined interface.
make_eventCreates an Event dataset from an input Table, Interval, or Resource dataset.
make_intervalCreates an Interval dataset from an input Table, Event, or Resource dataset.
make_metricCreates a metric dataset from dataset with precomputed time grid.
make_referenceCreate a reference table by aggregating data over time.
make_resourceCreates a Resource dataset from an input Event or Interval dataset.
make_sessionGroup events or intervals that are close to each other into sessions, and calculate aggregations over each session.
make_tableCreates a Table dataset from an input Event, Interval, or Resource dataset.
makeresourceDeprecated alias of make_resource.
makesessionDeprecated alias of make_session.
merge_eventsMerge consecutive events into new events based on merge conditions.
set_col_enumMark specified columns as enumerations, or not, so that the user interface can present them appropriately.
set_col_immutableMark resource columns as time immutable (time-invariant), or not.
set_col_searchableInclude or exclude columns from any future full-text search operation.
set_col_visibleShow or hide columns by name.
set_labelDeclare the 'label' of the output to be the designated column.
set_linkAdd a foreign key to the output, which identifies the target dataset and columns used to find a target resource.
set_metricRegister a metric, with its metadata defined in an options object.
set_metric_metadataSpecify the dataset that stores the metadata of the metrics defined in the current dataset.
set_pkAlias of set_primary_key.
set_primary_keyDeclare the primary key of the output as consisting of one or more named columns.
set_timestampDeclare the timestamp of the output to be the named column, which must have the timestamp type.
set_valid_fromDeclare the valid from of the output to be the named column, which must be a timestamp column.
set_valid_toDeclare the valid to of the output to be the named column, which must be a timestamp column.
setlabelDeprecated alias of set_label.
setpkDeprecated alias of set_primary_key.
setvfDeprecated alias of set_valid_from.
setvtDeprecated alias of set_valid_to.
sortSort rows in the dataset based on ordering functions applied to column fields or column name provided as arguments.
timeshiftShifts the timestamps of rows ahead in time by the specified interval.
unset_all_linksDrop all outbound links without having to specify the individual labels.
unset_keysRemove the primary and candidate key declarations from the dataset.
unset_linkDrop a foreign key by specifying the foreign keys label.
unsortRemove all column sort ordering metadata that may have been inserted by the sort verb.

Metrics Verbs

Metrics verbs create, aggregate, or normalize time series values. They are often used with aggregate functions.

VerbDescription
addmetricDeprecated alias of set_metric.
aggregateAggregates metrics across tag dimensions.
alignAlign raw metrics onto a time grid (defined by the input period) by aggregating nearby data points together.
make_metricCreates a metric dataset from dataset with precomputed time grid.
reaggregateDeprecated alias of aggregate.
rollupRollup raw metrics into aligned metrics.
set_metricRegister a metric, with its metadata defined in an options object.
timeshiftShifts the timestamps of rows ahead in time by the specified interval.

Projection Verbs

Projection verbs create, remove, or rename columns in a dataset.

VerbDescription
coldropDeprecated alias of drop_col.
colmakeDeprecated alias of make_col.
colpickDeprecated alias of pick_col.
colregexDeprecated alias of extract_regex.
colrenameDeprecated alias of rename_col.
drop_colExclude one or more columns from the input dataset to the output dataset.
extract_regexAdd one or more columns by matching capture names in a regular expression against a given source expression.
make_colAdd one or more new columns from the input dataset to the output dataset.
pick_colExclude all columns except the specified columns from the input dataset to the output dataset.
rename_colRenames a column.

Semistructured Verbs

Semistructured verbs act upon, or produce, arrays or objects that are treated as scalars. E.g., a single column may contain multiple values in an array, or multiple key/value tuples in an object.

The values inside semi-structured containers are stored as variants, and must be cast to the type you expect them to have. If the array or object contains a value of an unexpected type, the cast returns null.

VerbDescription
colregexDeprecated alias of extract_regex.
extract_regexAdd one or more columns by matching capture names in a regular expression against a given source expression.
flattenGiven an object or array input, recursively flatten all child elements into key-value columns, with null intermediates.
flatten_allGiven an object or array input, recursively flatten all child and intermediate elements into key-value columns.
flatten_leavesGiven an object or array input, recursively flatten all child elements into key-value columns, returning only leaf values.
flatten_singleGiven an object or array input, flatten the first level of child elements into key-value columns.
flattenallDeprecated alias of flatten_all.
flattenleavesDeprecated alias of flatten_leaves.
flattensingleDeprecated alias of flatten_single.