Splunk Search

how to get Stats sum of field with latest correlationId?

karthi2809
Builder

Hi All,

Below query to get stats sum of field values of latest correlationId. need to show in pie chart. But i am getting values as other.PFA screenshot

 

 index="mulesoft" *Upcoming Executions* content.scheduleDetails.lastRunTime="*"
[search index="mulesoft"  *Upcoming Executions*   environment=DEV | stats latest(correlationId) as correlationId | table correlationId|format]|rename content.scheduleDetails.lastRunTime as LastRunTimeCount | stats count(eval(LastRunTimeCount!="NA")) as LastRunTime_Count  count(eval(LastRunTimeCount=="NA")) as NA_Count by correlationId| stats   sum(LastRunTime_Count) as LastRunTime_Count,sum(NA_Count) as NA_Count

 

 

Labels (2)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Your last stats command outputs two columns LastRunTime_Count and NA_Count.  Pie chart can only use one column.  Can you illustrate your intentions with column output and describe how a pie chart can depict both?

0 Karma

karthi2809
Builder

Hi @yuanliu 

Thanks, how can we club the both into one to show count based on the two conditions

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Thanks, how can we club the both into one to show count based on the two conditions


What do you mean "based on the two conditions?"  Your original question simply says 

to show in pie chart. But i am getting values as other

The answer to this is: You cannot have a pie chart with two columns.  If you "getting values as other" is not the problem, what is?  Illustrate your data - in text (anonymize as needed), illustrate desired result - normally I'd say in text but in this case, a mockup graphic piechart could work, then, explain the logic to derive the desired results from illustrated data in plain language without SPL.  These are three essential ingredients of an answerable question.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...