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

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...