Splunk Search

Stats Command and timestamp

chuck_life09
Path Finder

Hi ,

I am using a stats command with a "by" time field, but i am not getting the result.

If i remove the time field i am getting the desired result. 

I want all the fields in my outcome, how to obtain.

stats latest(et) as "ET" by status, id, starttime - If i remove this "starttime" i am getting the outcome but i need that also in my outcome. Can i put a separate table? but there also this column is not showing.

I want all these fields ET,Status,id,Startime

What to do?

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Make sure the starttime field exists and has values in it.  The stats command will not produce results if one of the "by" fields is null.

It would help if you shared some sample data and a mock-up of the desired results.

---
If this reply helps you, Karma would be appreciated.
0 Karma

chuck_life09
Path Finder

Hi @richgalloway 

Sample data

Et                                           status       I'd              starttime

2021/07/01 04:00:00     failed        abcf

2021/07/01 03:24:00

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Is that data sample complete?  If so, then the null fields explains why the stat command fails.

---
If this reply helps you, Karma would be appreciated.
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!

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 ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...