Dashboards & Visualizations

Not show a row on chart but be available on results

HScorp
New Member

I'm trying to show a pie-chart distributed by country that when you go into view-results you can export to a csv.

A requirement is to include the totals, so I used "| addcoltotals labelfield=country label=ALL" of course now the pie chart have a 50% that corresponds to the country "ALL". Is there a way to exclude this row just from the chart representation? (Without just creating two different reports)

Tags (1)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Not too pretty, but this might work:

| gentimes start=-1 increment=5m | eval divider = starttime % 900 | stats avg(starttime) as avg by divider | eval total = avg | addcoltotals total | eval total = if(isnull(divider),total,null)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Put the "| gentimes ..." into the search bar on its own, to get a full example with generated events.

0 Karma

HScorp
New Member

I tried but tells me that gentimes have to be the first command. This is the original query:
earliest=-1d@d sourcetype="singleline_json" _type="UserReport" | stats dc(userId) AS "Number users" by country | addcoltotals labelfield=country label=ALL

So I tried: earliest=-1d@d sourcetype="singleline_json" _type="UserReport" | stats dc(userId) AS "Number users" by country | gentimes start=-1 increment=5m | eval divider = starttime % 900 | stats avg(starttime) as avg by divider | eval total = avg | addcoltotals total | eval total = if(isnull(divider),total,null)

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...