Splunk Search

Matching Results of a Search on One Value - Based on the Results of Two Events

Razziq
Explorer

Hello,

I am trying to configure alerting for a Failover Cluster by verifying the running server name, then confirming that the windows services on said server is running as expected.  We have two servers in the cluster that could change anytime, where the one that is active should always have the windows services running (and alert if they are not and it is the active host) and the passive server should have the services stopped (expected, no alert).

The two WMI events that I have running on the two hosts are below:

This event shows the active failover server:


Server=Server1
ComputerName=Cluster
wmi_type=PIAnalysisCluster

The below events shows the Windows Service events on either host:


Caption=Cluster Service
DisplayName=Cluster Service
Name=ClusSvc
ProcessId=3192
StartName=LocalSystem
State=Running
Status=OK
SystemName=Server1
wmi_type=ClusterService

20210325160700.359614
Caption=Cluster Service
DisplayName=Cluster Service
Name=ClusSvc
ProcessId=3040
StartName=LocalSystem
State=Running
Status=OK
SystemName=Server2
wmi_type=ClusterService

What i am trying to do is just show where Server=Server1 is active, then show just the status of the Windows Server from SystemName=Server1. I've tried with "eval Server=coalesce(SystemName,Server)", evals on match (Server==SystemName) as well "where Server=SystemName", but I have been unable to find a way to just show the active server based on the first event, and match the server name based on the second event with the status of the Windows Service.

Example attached of what the data looks like without attempting to join the values.

Razziq_0-1616715820198.png

 

 

Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Add this to the end of the query

| filldown ActiveHost
| where ActiveHost=SystemName

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

Add this to the end of the query

| filldown ActiveHost
| where ActiveHost=SystemName

Razziq
Explorer

This worked perfectly! Thank you very much, bowesmana!

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 ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...