Splunk Search

limiting error per event

cloud111
New Member

Hi,

I am new to splunk and would like guidance about how to only count 1 occurrence of the word ERROR per event.

example line:
2014-05-14 20:17:46,232 ERROR ejb.services.RestClientService Error processing response

my search is counting both errors in the line and i only need the first one

the search is:
index=main sourcetype=* source=* host=* ERROR source="D:/server.log"

Tags (1)
0 Karma

somesoni2
Revered Legend

WHat is your full search? How are you/search is counting it twice?

Are you just trying to select events with ERROR after timestamp? If yes try this

index=main sourcetype= source= host=* ERROR source="D:/server.log" | regex _raw="^\S+\s+\S+\s+ERROR\s.+"

If you're looking for just upper case ERROR, try this

index=main sourcetype= source= host=* CASE(ERROR) source="D:/server.log"
0 Karma

cloud111
New Member

Brilliant it works for me, I needed the first ERROR after the timestamp.
thanks so much for your help.

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

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 ...