Splunk Search

Data model

Hamza08
Observer

Hi, 

how can I rewrite the following search using tstats and datamodel Network_Traffic?

index=*pan* sourcetype="pan:threat" severity IN ("high", "critical")

so far I have tested the following:

| tstats count from datamodel=Network_Traffic by All_Traffic.src_ip

but given the fact that “severity” is not a field included in the datamodel but just in the index, how can I add the condition severity IN ("high", "critical")?

 

thank you!

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The tstats command only works with indexed fields.  If the field is not indexed and is not in a data model (same thing, really), then it can't be used with tstats.

---
If this reply helps you, Karma would be appreciated.
0 Karma

Hamza08
Observer

So if a field is not “Cim compliant” doest that mean that it cannot be used in tstats?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

CIM-compliance is different and has nothing to do with whether a field can be used in the tstats command.  CIM-compliance means a field has a name and value described in the CIM manual (https://docs.splunk.com/Documentation/CIM/5.3.2/User/Howtousethesereferencetables).

The only fields the can be used in tstats are those created at index-time or those in an accelerated datamodel.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...