Splunk Search

How to display a timechart of the Health Score as a function of time?

danishv
Loves-to-Learn Everything

I am calculating a health rate for projects based on specific criteria, generaly its the SUM of projects ranked A or B divided by the total number of projects.   I am trying to display a timechart of the Health Score as a function of time but with no luck.

Here is my search:

 

 

basesearch
| streamstats values(pipelineRun{}) as pipelines dc(pipelineRun{}) as num_pipelines by fullPath 
| spath path=project.Findings output=Findings 
| mvexpand Findings 
| spath input=Findings 
| eval ProjectRank=mvappend(ProjectRank, case(A>0 OR B>9, "F",
    A=1 OR (B<9 AND B>2) , "B",
    A=0 AND B=0, "A")) 
| eval PipelinesRank=mvappend(PipelinesRank, if(num_pipelines>8, "A", "F")) 
| eval ProjectFinalRank=mvappend(ProjectFinalRank, case(ProjectRank="F" OR PipelinesRank="F", "F",
    PipelinesRank="A" AND ProjectRank="B", "B",
    PipelinesRank="A" AND ProjectRank="A", "A")) 
| stats count by group ProjectFinalRank 
| stats sum(eval(if(ProjectFinalRank="A" OR ProjectFinalRank="B",count,0)))       AS HIGH sum(count) AS Total by group 
| eval HealthRate=round(HIGH*100/Total,2)

 

 

Labels (3)
0 Karma

danishv
Loves-to-Learn Everything

"with no luck" is with no success.

 

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

What I mean is: What does "no success" mean?  What is success?  What is your data like?  What is the expected result?  What is the logic connecting your data and your result?  It is hard for volunteers to read other people's mind (and speculate data characteristics) based on complex code snippets.

0 Karma

yuanliu
SplunkTrust
SplunkTrust

What does "with no luck" mean?

0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...