Splunk Search

Why does tstats not work with macros in child dataset?

kyokkygo
Engager

 

Screenshot 2023-02-03 at 13.37.51.png

I try use macros to get external indexes in child dataset VPN, but search with tstats on this dataset doesn't work.  Example of search:

 

 

| tstats values(sourcetype) as sourcetype from datamodel=authentication.authentication where nodename=authentication.VPN by nodename

 

 

  But when I explicitly enumerate the indexes, then everything works! And also it work with macros when i use search:

 

 

| from datamodel ...

 

 


What's problem? 

Labels (1)
0 Karma

diogofgm
SplunkTrust
SplunkTrust

If you use the pivot interface and select the VPN child do you get results?

Can you try this?
| tstats prestats=true summariesonly=false allow_old_summaries=true values(sourcetype) as sourcetype FROM datamodel=Authentication WHERE nodename=Authentication.VPN 
| stats dedup_splitvals=t values(sourcetype)

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...