Splunk Search

How to get the search report of a value?

runiyal
Path Finder

In the log there are events like -

{"submitterType":"Others","SubID":"App_4-45887-02232023"}

{"submitterType":"Others","SubID":"App_5-45892-02232023"}

 

I want a report showing -

App_4-45887-02232023

App_5-45892-02232023

 

Thanks!

Labels (1)
Tags (2)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

You didn't explain why Splunk does not give you SubID automatically.  The illustrated logs are conformant JSON.  If they are the raw events, there should be no reason that you don't have both fields submitterType and SubID.

If the illustrated log is one of fields that Splunk extracts for you, say "log", spath is the command to extract JSON nodes.

 

| spath input=log

 

Your sample data will give

SubIDsubmitterType
App_4-45887-02232023Others
App_5-45892-02232023Others
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You don't say much about what you need other than the results of that field, so in its basic form, you need to extract that SubID field if it's not already extracted and then do

your_search...
| table SubID

 If your data is JSON then SubID should be extracted

If you want to count the occurrrences of each SubID, then do

your_search...
| stats count by SubID
0 Karma

runiyal
Path Finder

Just trying to extract the field.

0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...