Splunk Search

Timechart based on max count of 3 fields

erica
Explorer

I was given a base search to manipulate and create Timechart accordingly.

base search
| eval file_line = file.":".line
| eval errorList = message . ":" . file_line . ":" . level
| top 25 message,file_line,level by applicationBuild
| table applicationBuild level count file_line message

The result was formatted as such

build2021ERROR8file1.java:111ErrorMessage123
build2021ERROR4file2.java:123ErrorMessage456
build2021ERROR3file3.java:456ErrorMessage789

 

I want to plot a Timechart from the above result. Output should be Top 25 Error message above against time.

I came out with

base search 
| eval file_line = file.":".line
| eval errorList = message.";".file_line.";".level
| where errorList!="null"
| timechart useother=f usenull=f count max(message,file_line,level,applicationBuild) by errorList limit=25

 

The legend of the result will append "count: " in front of the errorList that I cannot remove.

Any idea how can I remove this from the legend?

OR

are there better ways to achieve the same result?

erica_1-1638182325631.png

 

 

Labels (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

It is because you're calculating two separate statistics for each timepoints and in order to allow you to distinguish between them splunk calls them by the aggregation function you used.

You can add

| rename "count: *" as *

to remove the "count:" part from the column names.

View solution in original post

0 Karma

PickleRick
SplunkTrust
SplunkTrust

It is because you're calculating two separate statistics for each timepoints and in order to allow you to distinguish between them splunk calls them by the aggregation function you used.

You can add

| rename "count: *" as *

to remove the "count:" part from the column names.

0 Karma

erica
Explorer

Thank you! this solve my problem 

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...