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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...