Splunk Search

how to add labels to chart values or order timechart

0range
Communicator

Hello.
My query looks like
...| timechart count by type
And I have values tupe_a, type_b and so on. When I call them like
eval name=case(type=type_a, "Error", type=type_b, "OK")...
and use "count by name" the rows in my staced timechart are ordered by name. But I need it to order by summary count. When I use "count by type" , they are ordered by summary count. How to specify the order or rename the types on the final chart?

Tags (3)
0 Karma

linu1988
Champion

Using timechart it's not possible as the values sorted will be distorting the time in the chart. Better use the stats function and do the calculation after the eval. Then apply the sort function. Thanks.

0 Karma

HiroshiSatoh
Champion

If you just add a total row

…|addcoltotals labelfield=name label=ALL

name count
Error 10
OK 100
ALL 110

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...