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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...