Splunk Search

How to count errors for only a certain application?

lsy9891
Engager

Hi, my query returns exceptions thrown by every application. How do I filter this query to display only certain applications like Application="jobs"?

(index= OR index=_) (host="NETWEBA*" OR host="NETWEBB*" OR host="NETAPPA*" OR host="WEBADMIN*") Exception earliest=-7d@d latest=@d | rex field=WindowsIdentity "\+(?.*?).+monster" | timechart span=1h count by Application

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

You basically need to apply the filter based on Application field. If the field Application is already extracted (coming as part of the base search), you'd apply the filterApplication="YourAppNameHere" in the base search. If The field Application is not already extracted and you're extracting it via that rex command in your search, you'll apply filter after the field is extracted.

Base search filter:

(index=* OR index=_*) (host="NETWEBA*" OR host="NETWEBB*" OR host="NETAPPA*" OR host="WEBADMIN*") Exception Application="YourAppNameHere" earliest=-7d@d latest=@d | rex field=WindowsIdentity "\\\+(?<Somefieldname>.*?)\.+monster" | timechart span=1h count by Application

Filter after subsearch

(index=* OR index=_*) (host="NETWEBA*" OR host="NETWEBB*" OR host="NETAPPA*" OR host="WEBADMIN*") Exception earliest=-7d@d latest=@d | rex field=WindowsIdentity "\\\+(?<Application>.*?)\.+monster" | where Application="YourAppNameHere" | timechart span=1h count by Application

View solution in original post

0 Karma

somesoni2
Revered Legend

You basically need to apply the filter based on Application field. If the field Application is already extracted (coming as part of the base search), you'd apply the filterApplication="YourAppNameHere" in the base search. If The field Application is not already extracted and you're extracting it via that rex command in your search, you'll apply filter after the field is extracted.

Base search filter:

(index=* OR index=_*) (host="NETWEBA*" OR host="NETWEBB*" OR host="NETAPPA*" OR host="WEBADMIN*") Exception Application="YourAppNameHere" earliest=-7d@d latest=@d | rex field=WindowsIdentity "\\\+(?<Somefieldname>.*?)\.+monster" | timechart span=1h count by Application

Filter after subsearch

(index=* OR index=_*) (host="NETWEBA*" OR host="NETWEBB*" OR host="NETAPPA*" OR host="WEBADMIN*") Exception earliest=-7d@d latest=@d | rex field=WindowsIdentity "\\\+(?<Application>.*?)\.+monster" | where Application="YourAppNameHere" | timechart span=1h count by Application
0 Karma

renjith_nair
Legend

@lsy9891,

Have you tried adding the condition to the base search ?

ie.

  (index= OR index=_) ......... Application="jobs" earliest=-7d@d latest=@d 

If there are multiple applications , you could try with OR or IN

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

Sukisen1981
Champion

what all have you tried so far @lsy9891 ?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...

Operationalizing TDIR: Building a More Resilient, Scalable SOC

Optimizing SOC workflows with a unified, risk-based approach to Threat Detection, Investigation, and Response ...