Alerting

How to pass one alert results to another alert?

AKG1_old1
Builder

Hi,

In first alert query it produce a list of ID's which need to be passed to another alert query. will it be possible to implement like this.

First Alert Query:

| tstats  values(MXTIMING.ID) as IDmax(MXTIMING.Memory) AS Memory FROM datamodel=MXTIMING_V9 WHERE host=*   AND MXTIMING.Memory>5000 GROUPBY  source | table ID
   | table ID

Second Alert Query:

| tstats max(MXTIMING.Memory) AS VmPeak FROM datamodel=MXTIMING_V9 WHERE  MXTIMING.Context+Command="*" AND MXTIMING.ID IN  ("ID1" "ID2" "ID3" "ID4" "ID5" )  GROUPBY MXTIMING.Context+Command MXTIMING.Time _time span=1s source
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Use a subsearch. Remember that subsearches execute first and pass their results to the parent search.

| tstats max(MXTIMING.Memory) AS VmPeak FROM datamodel=MXTIMING_V9 WHERE  MXTIMING.Context+Command="*" AND
   [| tstats  values(MXTIMING.ID) as MXTIMING.ID max(MXTIMING.Memory) AS Memory FROM datamodel=MXTIMING_V9 WHERE host=* AND MXTIMING.Memory>5000 GROUPBY source 
   | fields MXTIMING.ID | format ] 
GROUPBY MXTIMING.Context+Command MXTIMING.Time _time span=1s source 
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use a subsearch. Remember that subsearches execute first and pass their results to the parent search.

| tstats max(MXTIMING.Memory) AS VmPeak FROM datamodel=MXTIMING_V9 WHERE  MXTIMING.Context+Command="*" AND
   [| tstats  values(MXTIMING.ID) as MXTIMING.ID max(MXTIMING.Memory) AS Memory FROM datamodel=MXTIMING_V9 WHERE host=* AND MXTIMING.Memory>5000 GROUPBY source 
   | fields MXTIMING.ID | format ] 
GROUPBY MXTIMING.Context+Command MXTIMING.Time _time span=1s source 
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...