Splunk Search

Not showing field in tstats query that is defiend in datamodel.

abhishekpatel2
Explorer

We have datamodel which has 2 level DataSet(Datamodel-> Parent Dataset -> Child Dataset). We have defiend a field in Child Dataset and we are able to see that field value on preview. 
DatamodelCatalyst_App
Parent Dataset: Catalyst_Dataset

Child Dataset: Security_Advisories_Events

Field: Category

So when we are trying to run the following tstats query:

| tstats summariesonly=false values(Catalyst_Dataset.Security_Advisories_Events.Category) from datamodel=Catalyst_App where nodename=Catalyst_Dataset.Security_Advisories_Events

Screenshot 2024-06-06 111121.png

We are getting no results. But at the same time when we run the following datamodel query:

| datamodel Catalyst_App Security_Advisories_Events search
| fillnull value="-"
| table Catalyst_Dataset.Security_Advisories_Events.Category

Screenshot 2024-06-06 111140.png

We are getting category values in datamodel query.

 
Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @abhishekpatel2,

try adding the BY clause:

| tstats summariesonly=false 
     count
     FROM datamodel=Cisco_Catalyst_App 
     WHERE where nodename=Cisco_Catalyst_Dataset.Cisco_Security_Advisories_Events
     BY Catalyst_Dataset.Security_Advisories_Events.Category
| table Catalyst_Dataset.Security_Advisories_Events.Category

Ciao.

Giuseppe

0 Karma

abhishekpatel2
Explorer

Tried this but have no luck with this.

0 Karma

abhishekpatel2
Explorer

I tried that too, but in that I am getting no results.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @abhishekpatel2 ,

try to create your search using Pivot, starting from your DataModel.

Then see in Job Inspector the generated search, maybe there's an error in field names.

Ciao.

Giuseppe

0 Karma

abhishekpatel2
Explorer

Not helpful as all the fields are correct.

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...