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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...