Dashboards & Visualizations

How to create multiple drilldown in a pie chart?

macadminrohit
Contributor

Hi,

I have a search query through which i am creating a pie chart. one piece of the pie chart will show the successful events, other piece will show the Error events from the search. My requirement is to drill down to the respective events by clicking on the pieces of the pie chart.

index=_internal sourcetype=abc host=server1 source!="*SEND_EMAILS*" NOT "NO ERRORS" | dedup source  | eval fail=if(searchmatch("error OR fail*"),1,0)  | stats count as Total sum(fail) as "Error/failed" | transpose

This creates a pie chart with error and total events. So if i click on Error piece it should take me to the events which resulted in error and if i click on rest of the pie chart it should take me to the total events.

0 Karma
1 Solution

sundareshr
Legend

Try like this

<dashboard>
  <label></label>
  <row>
    <panel>
      <chart>
        <title>f:$f$</title>
        <search>
          <query>index=_internal sourcetype=abc host=server1 source!="*SEND_EMAILS*" NOT "NO ERRORS" 
| dedup source 
| eval fail=if(searchmatch("error OR fail*"),1,0) 
| stats count as Total sum(fail) as "Error/failed" 
| eval Total=100 
| eval "Error/failed"=25
| transpose</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
        <option name="charting.axisTitleX.visibility">visible</option>
        <option name="charting.axisTitleY.visibility">visible</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.enabled">0</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart">pie</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.showDataLabels">none</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">default</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">right</option>
        <drilldown>
          <eval token="f">if(match($click.value$, "Error"), "error OR fail\*", "\*"</eval>
        </drilldown>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <event>
        <search>
          <query>index=_internal sourcetype=abc host=server1 source!="*SEND_EMAILS*" NOT "NO ERRORS" 
| dedup source
| eval fail=if(searchmatch("$f$"),1,0) 
| where fail=1</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
      </event>
    </panel>
  </row>
</dashboard>

View solution in original post

0 Karma

sundareshr
Legend

Try like this

<dashboard>
  <label></label>
  <row>
    <panel>
      <chart>
        <title>f:$f$</title>
        <search>
          <query>index=_internal sourcetype=abc host=server1 source!="*SEND_EMAILS*" NOT "NO ERRORS" 
| dedup source 
| eval fail=if(searchmatch("error OR fail*"),1,0) 
| stats count as Total sum(fail) as "Error/failed" 
| eval Total=100 
| eval "Error/failed"=25
| transpose</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
        <option name="charting.axisTitleX.visibility">visible</option>
        <option name="charting.axisTitleY.visibility">visible</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.enabled">0</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart">pie</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.showDataLabels">none</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">default</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">right</option>
        <drilldown>
          <eval token="f">if(match($click.value$, "Error"), "error OR fail\*", "\*"</eval>
        </drilldown>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <event>
        <search>
          <query>index=_internal sourcetype=abc host=server1 source!="*SEND_EMAILS*" NOT "NO ERRORS" 
| dedup source
| eval fail=if(searchmatch("$f$"),1,0) 
| where fail=1</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
      </event>
    </panel>
  </row>
</dashboard>
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Self-Healing Pipeline Is Now Generally Available: AI-Powered CIM Compliance

Maintaining data integrity across security and analytics pipelines is an ongoing challenge. Data ...

[Puzzles] Solve, Learn, Repeat: Family Trees

This puzzle (first published here is based on finding grandparents and grandchildren (inspired by a question ...

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...