Splunk Search

Why is tstats not working on docker image datasets?

joniba
Engager

I'm totally and utterly new to splunk. Just ran the dockerhub sample, and followed the instructions: https://hub.docker.com/r/splunk/splunk/

I opened the search tab and most search commands seem to work fine.  For example, the following command:

 

 

| from datamodel:"internal_server.server"
| stats count

 

 

 Returns a count of 33350.

While this command:

 

 

| tstats count from datamodel:"internal_server.server"

 

 

as well as this one:

 

 

| tstats count

 

 

both return zero.

How can I get tstats working in this docker env with the sample datasets?

Labels (1)
Tags (2)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

OK. The tstats command has a bit different way of specifying dataset than the from command.

So you should be doing

| tstats count from datamodel=internal_server.server

And it's irrelevant whether it's a docker container or any other way of deploying Splunk because the commands work the same way regardless of how the software is deployed.

View solution in original post

PickleRick
SplunkTrust
SplunkTrust

I don't know what dataset you're working with but the first thing that comes to mind is that your datamodel is not accelerated. If you don't have accelerated summaries, tstats has nothing to operate on.

And it's completely irrelevant if it's a docker image, VM or bare metal install.

0 Karma

joniba
Engager

Hey @PickleRick , I went into the settings for the dataset and enabled acceleration (via Edit Acceleration). Also the dataset shows up as accelerated in the list of datasets. Shouldn't that have resolved the issue?

Also, why do you say it's irrelevant on a docker image? Is it not supposed to work on docker?  

Do you know of any documentation describing this?

0 Karma

PickleRick
SplunkTrust
SplunkTrust

OK. The tstats command has a bit different way of specifying dataset than the from command.

So you should be doing

| tstats count from datamodel=internal_server.server

And it's irrelevant whether it's a docker container or any other way of deploying Splunk because the commands work the same way regardless of how the software is deployed.

Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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