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!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...