Splunk Search

tstats not working on all index time fields?

moneybox
Explorer

I have a python script (requests and post) that sends json events to an Indexer using HTTP Event Collector (HEC).
I can perform searches like

| tstats count where host=XXX by sourcetype
yet I cannot perform tstats searches on fields inside the event, even though they are json fields that are extracted in index time.

How can I make sure a search like

| tstats count where host=XXX by json_field_1
will work ?

Thank you

0 Karma
1 Solution

cpetterborg
SplunkTrust
SplunkTrust

Unless you have the JSON field you want INDEXED, you will not be able to use it in a tstats command. tstats can only work of things that are in the tsidx file (like source, sourcetype, index, host, _time, etc.) and those fields which are indexed (so that means the field extractions would have to be done through the props.conf files on the indexers). If that is not the case in this instance, then you cannot use something like json_field_1 in that search.

View solution in original post

0 Karma

cpetterborg
SplunkTrust
SplunkTrust

Unless you have the JSON field you want INDEXED, you will not be able to use it in a tstats command. tstats can only work of things that are in the tsidx file (like source, sourcetype, index, host, _time, etc.) and those fields which are indexed (so that means the field extractions would have to be done through the props.conf files on the indexers). If that is not the case in this instance, then you cannot use something like json_field_1 in that search.

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 ...