Splunk Search

Timechart after sort display

Hod152
Explorer

Hey,
Iv'e noticed some wierd behviour that is making me suspect the relaibility of my queries so I'm really looking for an explanation, I was making some searches and displaying them on a timechart, for some reason the timechart looks completly different when I sort the fields befor.

this is the basic search and it's results:

 

 

|tstats count WHERE case=test responseCode=200 requestStatus!=legal by clientIp _time span=1h| timechart sum(count) span=1h

 

 

Hod152_2-1721131756532.png


After sorting clientIp field this is how the graph looks like:

 

 

|tstats count WHERE case=test  responseCode=200 requestStatus!=legal by clientIp _time span=1h| sort -clientIp |timechart sum(count) span=1h

 

 

Hod152_1-1721131709287.png

 

 

|tstats count WHERE case=test responseCode=200 requestStatus!=legal by clientIp _time span=1h| sort +clientIp |timechart sum(count) span=1h

 

 

Hod152_3-1721132009680.png

Note that the count is decreased on the sorted search.

 

 


What can explain that behaviour? Which chart should I relay on? Is that a feature of sorting?

Thanks

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

sort truncates at 10k values - try something like this

| sort 0 -clientip

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

sort truncates at 10k values - try something like this

| sort 0 -clientip

Hod152
Explorer

Thanks!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Hod152,

why you did this?

if you have tstats BY _time, you already have the timechart:

 

| tstats 
     count 
     WHERE case=test  responseCode=200 requestStatus!=legal 
     BY clientIp _time span=1h

 

Anyway, it's always better to indicate the indexes to use in the search, to have more performant searces  and avoid default search path issues.

Ciao.

Giuseppe

0 Karma

Hod152
Explorer

It just suited my work sequence...

0 Karma
Get Updates on the Splunk Community!

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Get Inspired! We’ve Got Validation that Your Hard Work is Paying Off

We love our Splunk Community and want you to feel inspired by all your hard work! Eric Fusilero, our VP of ...

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...