Splunk Enterprise

Can you help me create a pie chart based on multiple searches?

karthi25
Path Finder

I need to create a pie chart based on different types of logs. I tried the below query,

index=*** source=**** earliest=-7d@h latest=now  | append [search spath=TestSplunkLog.TestFailureLog.payload.failureCount output=failureCount|stats sum(failureCount) as TOTAL | eval Type="FAILURE" ] | append [search spath=TestSplunkLog.TestSuccessLog.payload.publishedCount output=publishedCount|stats sum(publishedCount) as TOTAL | eval Type="PUBLISHED" ]  | append [search spath=TestSplunkLog.TestSuccessLog.payload.duplicateCount output=duplicateCount|stats sum(duplicateCount) as TOTAL | eval Type="DUPLICATE" ]| stats values(TOTAL) by Type

But it is not returning anything. Can anyone please suggest me the right solution for my problem?

0 Karma
1 Solution

tiagofbmm
Influencer

You are not specifying where within your subsearches are you trying yo use spath, so nothing comes out of it.

Few things, use the argument path in the spath.

Do all the spaths as you need directly from what you are getting from the Index:

index=****** earliest=-7d@h latest=now 
spath path=TestSplunkLog.TestFailureLog.payload.failureCount output=failureCount
spath path=TestSplunkLog.TestSuccessLog.payload.publishedCount output=publishedCount 
spath path=TestSplunkLog.TestSuccessLog.payload.duplicateCount output=duplicateCount 
| table failureCount publishedCount duplicateCount
| transpose 0 column_name="TYPE"
| stats sum("row 1") as total by TYPE

View solution in original post

tiagofbmm
Influencer

You are not specifying where within your subsearches are you trying yo use spath, so nothing comes out of it.

Few things, use the argument path in the spath.

Do all the spaths as you need directly from what you are getting from the Index:

index=****** earliest=-7d@h latest=now 
spath path=TestSplunkLog.TestFailureLog.payload.failureCount output=failureCount
spath path=TestSplunkLog.TestSuccessLog.payload.publishedCount output=publishedCount 
spath path=TestSplunkLog.TestSuccessLog.payload.duplicateCount output=duplicateCount 
| table failureCount publishedCount duplicateCount
| transpose 0 column_name="TYPE"
| stats sum("row 1") as total by TYPE

chsingh
Observer

I've three search in OR for ex 

"order success"

"order failed"

"offer success" 

based on the above 3 statement I can perform search but I want to show the result in as pie chart at per hour basis

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...