Dashboards & Visualizations

join SingleValue search

kris99
New Member

how do I join below two searches and return within same SingleValue with following conditions..

If "ConnectionStatus" is "On" and "Events" is "0" , display "No Errors" with low range
If "ConnectionStatus" is "On" and "Events" is greater than "0" , display "Warning" with elevated range
If "ConnectionStatus" is NOT "On" and "Events" is greater than "0" , display "Error" with severe range

ConnectionStatus
index=xxx sourcetype="ConnectionStatus" State!="On" |stats first(State) as State | stats count | appendpipe [ stats count | eval Status="Up" | where count==0 ] | eval Status=if(count==0,"Up","Down") | eval range = if(Status=="No Errors","low","severe")

Events
index=yyy sourcetype="Events" Type!=Information (EventCode>="3012" AND EventCode<="3054") | stats count | eval StateBool = if (count==0, 0, 1) | eval Status=if(count==0,"No Errors","Warning") | rangemap field=StateBool low=0-0 elevated=1-1 | table Status range

0 Karma
1 Solution

sk314
Builder

If I understand it correctly, this should work:

index=xxx sourcetype="ConnectionStatus" State!="On"| stats count AS connection_off_count | appendcols [ index=yyy sourcetype="Events" Type!=Information (EventCode>="3012" AND EventCode<="3054") | stats count AS event_error_count] | eval warning_type = case( (connection_off_count ==0) AND (event_error_count == 0), "No Errors", (connection_off_count ==0) AND (event_error_count > 0), "Warning", (connection_off_count > 0) AND (event_error_count > 0),"Error") | table warning_type

View solution in original post

0 Karma

sk314
Builder

If I understand it correctly, this should work:

index=xxx sourcetype="ConnectionStatus" State!="On"| stats count AS connection_off_count | appendcols [ index=yyy sourcetype="Events" Type!=Information (EventCode>="3012" AND EventCode<="3054") | stats count AS event_error_count] | eval warning_type = case( (connection_off_count ==0) AND (event_error_count == 0), "No Errors", (connection_off_count ==0) AND (event_error_count > 0), "Warning", (connection_off_count > 0) AND (event_error_count > 0),"Error") | table warning_type
0 Karma

sk314
Builder

you could pipe your rangemap logic before the table command. It should work.

0 Karma

kris99
New Member

Thank you. That works.

But how do I use range / rangemap with that search ?

No Errors is Green Tick , Warning is Orange & Error is Red cross

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