Splunk Search

Why is tstats aggragate function not returning results?

lnvaderzee
Loves-to-Learn

So I'm fairly new to using data models for my visuals, and converting my network performance dashboard to summarized data model searched. My visuals for error rate and request volume worked easily, but latency not so much. Here's the search I am attempting:

| tstats summariesonly=t avg(All_Performance.Network.latency) from datamodel=Performance.All_Performance where nodename=All_Performance.Network BY _time span=15s

 

here are searches that work:

| tstats summariesonly=t count(All_Performance.Network.latency) from datamodel=Performance.All_Performance where nodename=All_Performance.Network BY _time span=15s

 

| from datamodel Performance.Network | timechart span=15s avg(latency) as latency

 

Can someone explain why tstats count() works here, but not min, avg, max, etc?

Labels (2)
0 Karma

somesoni2
Revered Legend

Check datamodel definition to see the data type for the field Latency whether it's a number or string. Avg works with numbers.

0 Karma

lnvaderzee
Loves-to-Learn

That was actually my first thought. I checked and when I made the field I did in fact have it as string, but changed it and rebuilt the acceleration. So it wasn't that

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...