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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...