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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...

[Puzzles] Solve, Learn, Repeat: Dereferencing XML to Fixed-length events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...