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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...