This page explains how to use the spotlight function in APL to compare a selected set of events against a baseline and surface the most significant differences.
Splunk SPL users
eval
, run separate stats
/eventstats
for each field, and then appendpipe
or join
to compare rates. In APL, spotlight
is an aggregation you call once inside summarize
. You pass a Boolean predicate to define the cohort and a list of fields to inspect, and APL returns a scored table of differences.ANSI SQL users
CASE
a selection flag, aggregate twice (selected vs baseline), compute proportions, deltas, and significance, then union and sort. In APL, you express the selection as a predicate and let spotlight
compute proportions, lift, and scores for each field/value.spotlight
inside summarize
. The first argument defines the comparison set. The remaining arguments list the fields to analyze.
Name | Type | Description |
---|---|---|
SelectionPredicate | Boolean expression | Defines the comparison set (selected cohort). Spotlight compares events where the predicate evaluates to true against the baseline (events where it evaluates to false ) within the current query scope. |
Field1 ... FieldN | field references | One or more fields to analyze. Include string or categorical fields (for proportions) and numeric or timespan fields (for distributional differences). |
where
scope broad enough that the baseline remains meaningful. Over-filtering reduces contrast.req_duration_ms
or duration
to let Spotlight detect distribution shifts, not just categorical skews.spotlight
to compare selected vs baseline inside that scope.spotlight
is an aggregation you call within summarize
.top
for simple frequency counts; use spotlight
to contrast a cohort against its baseline with lift and significance.lookup
to add context before running spotlight
across enriched fields.