Splunk Search

FULL NULL Values based on certain values

davidcraven02
Communicator

The OverAllStatus only displays on the first row but I require the OverAllStatus to be displayed on each row for each machine (either Pass or Fail).

I need some sort of eval to correctly assign the OverAllStatus on each row for each machine.

I use this eval to determine if the OverAllStatus is a Pass or Fail in the first place

 | eval OverAllStatus=case(jobStatusSummary="Success", "Pass", jobStatusSummary="NoBackUp", "NoBackUp", jobStatusSummary!="Success", "Fail") 

alt text

0 Karma
1 Solution

micahkemp
Champion

Try:

| eval OverAllStatus=case(jobStatusSummary="Success", "Pass", jobStatusSummary="NoBackUp", "NoBackUp", jobStatusSummary!="Success", "Fail") | streamstats last(OverAllStatus) AS OverAllStatus BY machine

That assumes the first event per host already have an OverAllStatus value. If it is possible that value won't be present for the first event per machine you may try this:

| eval OverAllStatus=case(jobStatusSummary="Success", "Pass", jobStatusSummary="NoBackUp", "NoBackUp", jobStatusSummary!="Success", "Fail") | eventstats last(OverAllStatus) AS OverAllStatus BY machine

View solution in original post

DalJeanis
Legend

Add a line after you set OverAllStatus...

| eventstats max(OverAllStatus) as OverAllStatus by machine

micahkemp
Champion

Try:

| eval OverAllStatus=case(jobStatusSummary="Success", "Pass", jobStatusSummary="NoBackUp", "NoBackUp", jobStatusSummary!="Success", "Fail") | streamstats last(OverAllStatus) AS OverAllStatus BY machine

That assumes the first event per host already have an OverAllStatus value. If it is possible that value won't be present for the first event per machine you may try this:

| eval OverAllStatus=case(jobStatusSummary="Success", "Pass", jobStatusSummary="NoBackUp", "NoBackUp", jobStatusSummary!="Success", "Fail") | eventstats last(OverAllStatus) AS OverAllStatus BY machine

davidcraven02
Communicator

Thank you very much for your help, this is great!

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...