This page explains how to use the set_intersect function in APL.
set_intersect
function in APL to find common elements between two dynamic arrays. This function returns a new array that contains only the elements that appear in both input arrays, preserving the order from the first array and eliminating duplicates.
You can use set_intersect
when you need to compare sets of values—for example, to find users who accessed two different URLs, or to identify traces that passed through multiple services. This function is especially useful for working with dynamic fields generated during aggregations or transformations.
Splunk SPL users
set_intersect
, but you can achieve similar functionality using mvfilter
with conditions based on a lookup or manually defined set. APL simplifies this process by offering a built-in array intersection function.ANSI SQL users
UNNEST
or JOIN
, which can be verbose. In APL, set_intersect
performs this in a single step.Name | Type | Description |
---|---|---|
Array1 | dynamic | The first array to compare. |
Array2 | dynamic | The second array to compare. |
Array1
and Array2
, in the order they appear in Array1
, with duplicates removed.
set_intersect
to return the intersection of two arrays.
Query
_time | together |
---|---|
May 22, 11:42:52 | [2, 3] |