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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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