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!

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