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!

Notification Email Migration Announcement

The Notification Team is migrating our email service provider from Postmark to AWS Simple Email Service (SES) ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...