Splunk Search

Eval math expression over null values

splunk_zen
Builder

How can I get a result out of an eval expression (without falsely decreasing the result computing its components as 0) if I there is a day and a half which I have no data?

My goal is to timechart a score with that gap in it, not represent the lack of data as 0.

If I replace the

TotalEvents,0 

by

TotalEvents,"" 

in the eval expressions,
The CpuScore eval just breaks and is always null acroos All Time, even on the other days which I have data.

| eval ACpuApdex=if(Platform="A",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
| eval BCpuApdex=if(Platform="B",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
...
| eval BCpuApdex=if(Platform="K",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
| eval CpuScore=round(
100*(
0.16*(0.7*ACpuApdex + B*FeCpuApdex)
+ 0.16*CCpuApdex 
...
)
)
| timechart span=1d sum(CpuScore) as CpuScore
Tags (2)
0 Karma

lpolo
Motivator

Have tried:
| timechart cont=false span=1d sum(CpuScore) as CpuScore

0 Karma

splunk_zen
Builder

Thanks Ipolo.
The issue is that the result of

| eval CpuScore=...

is either 0 in that given day(if I leave the TotalEvents,0
in the previous eval expressions)

or null across All Time (if I replace it by TotalEvents,"")

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