⛏️GetSplunky!
Lv.1Intern
0 XP
0
Home Map Stats Drill Board Log In
CoursesArticlesSPL Cheat SheetCertification PathAboutPrivacyTerms

Splunky is an independent, free study resource. It is not affiliated with, endorsed by, or sponsored by Splunk or Cisco. Splunk, SPL and related marks are trademarks of Splunk, a Cisco company, and are used here only to identify the certifications this site helps you study for.

© 2026 Splunky

Back to Floor
The Sentinel Watchtower • Room 3

Custom SignalFlow Alerts with detect() & when()

When built-in templates cannot express multi-signal conditions or duration rules, write Custom SignalFlow detectors with detect() and when().

The when(predicate, lasting=..., at_least=...) function turns a boolean condition (such as cpu > 90) into an event trigger. Adding lasting='5m' requires the condition to remain true across a 5-minute window before firing, while at_least=0.8 allows triggering if it holds for 80% of that window (tolerance for brief 1-sample dips).

Passing the when() expression into detect() creates the alert stream, and calling .publish('Alert Rule Name') registers it as an active rule inside the detector.

Custom SignalFlow Detector with Anti-Flapping
cpu = data('cpu.utilization').mean(by='host.name')
detect(when(cpu > 90, lasting='5m', at_least=1.0)).publish('Sustained High CPU')
You can pass separate clear conditions to detect(on=when(...), off=when(...)) to introduce hysteresis so an alert does not rapidly fire and clear right around a threshold.

Knowledge Check

Prove your understanding to clear the room (Rewards XP)
Complete this custom SignalFlow detector rule to fire only when mean CPU exceeds 85% continuously for 10 minutes:
cpu = data('cpu.utilization').mean(by='host.name')
((cpu > 85, ='10m')).publish('High CPU > 85%')