Splunk Search

using tstats with a datamodel

rettops
Path Finder

I'm trying to use tstats from an accelerated data model and having no success. I took a look at the Tutorial pivot report for Successful Purchases:

| pivot Tutorial Successful_Purchases count(Successful_Purchases) AS "Count of Successful Purchases" sum(price) AS "Sum of Price" SPLITROW productName AS "Product Name" SPLITROW price AS "Price" SORT 100 productName

In the search.log for that report, it says that eventSearch is:

tstats count AS "Count of Successful Purchases" sum("Purchase_Requests.price") AS "Sum of Price" from datamodel="Tutorial" where (nodename="Purchase_Requests") (nodename="Purchase_Requests.Successful_Purchases") groupby "Purchase_Requests.productName" "Purchase_Requests.price" prestats=true

I tried doing that and get 'No results found'. Even

tstats count from datamodel="Tutorial"

gives no results. What am I doing wrong?

1 Solution

rettops
Path Finder

Duh ... add a pipe to the beginning and strip off the "prestats = true" and suddenly I get results.

View solution in original post

rettops
Path Finder

Duh ... add a pipe to the beginning and strip off the "prestats = true" and suddenly I get results.

Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...