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!

Index This | A sphere has three, a circle has two, and a point has zero. What is it?

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

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...