Splunk Search

How to use inner search in tstats?

ugy
Explorer

Hello Team,

I'd like to know about How to use inner search in tstats?

I use that

| tstats count from datamodel=ITSI_DM where [ search index=idx_qq sourcetype=q1 | stats c by AAA] by ITSI_DM_NM.AAA

But No Result.
How to use inner search in tstats?

Tags (2)
0 Karma
1 Solution

rjthibod
Champion

You are close but you need to limit the output of your inner search to the one field that should be used for filtering.

| tstats count from datamodel=ITSI_DM where [search index=idx_qq sourcetype=q1 | stats c by AAA | sort 10 -c | fields AAA | rename AAA as ITSI_DM_NM.AAA] by ITSI_DM_NM.AAA

View solution in original post

rjthibod
Champion

You are close but you need to limit the output of your inner search to the one field that should be used for filtering.

| tstats count from datamodel=ITSI_DM where [search index=idx_qq sourcetype=q1 | stats c by AAA | sort 10 -c | fields AAA | rename AAA as ITSI_DM_NM.AAA] by ITSI_DM_NM.AAA

ugy
Explorer

Thank you for your Answer!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...