Splunk Enterprise Security

stats command with data model and raw data does not works properly

SIEMStudent
Path Finder

Hi Splunkers, we have a behavior that we are not able to understand.
The problem is the following: we are performing some search using data model and, when we need to use stats, we would select both fields row data and datamodel one. However, when we try this, we are not able to see the raw fields.

Let me show an example to better explain.

If we try this simple search:

| from datamodel:"Authentication"
| search is_Failed_Authentication=1
| stats count by log_region log_country user

we expect that stats show in outoput the 2 fields we manually added to data, log_region and log_contry, and the one owned by datamodel, which is user.

Unfortunately, when the result appear we can see only user in the returned table; log_region and log_country are empty.

We know the those data are present and populated because, if we try to replicate the search with same time range but using not datamodel, and so using the specific index, sourcetype and source for windows events, the stats return the output with all 3 fields (in this case, user is of course the specific field of Windows events).

Is this normal? Is there a way to use both raw/manually added fields and datamodel ones?

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

When searching with a datamodel the only fields available are those specified in the DM.

A search that does not use a DM has access to all of the fields in the index(es).

To have it both ways, use two searches and combine them using a subsearch.

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

When searching with a datamodel the only fields available are those specified in the DM.

A search that does not use a DM has access to all of the fields in the index(es).

To have it both ways, use two searches and combine them using a subsearch.

---
If this reply helps you, Karma would be appreciated.
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 ...