Splunk Search

How to Extract specific word from application log

iqbalintouch
Path Finder

Here is the sample log and I need to check which modelId is having most of the error using rex and stats count

####<Jan 11, 2021 11:17:52.338 PM PST> <ERROR> <myapp.main.catalog.store.trxn.OrderResponseValidator> <bus-ser15> <bus-ser1515_5> <requestId=9c4q00cv-e10x-00b4-z55f-11b44dc4c37m> <clientIp=11.22.33.222> <myapp.main.catalog.store.trxn.OrderResponseValidator.logOrderResponseValidationError(?:?):Productadd service error for modelId 765431 and reference number null[Model is not available in the store], [An error has occurred. Please verify your order status.]>

Can someone please help?

Labels (3)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @iqbalintouch,

You can use below query;

| rex field=_raw "modelId\s(?<modelId>\d+)"
| stats count by modelId

 

If this reply helps you an upvote is appreciated.

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

scelikok
SplunkTrust
SplunkTrust

Hi @iqbalintouch,

You can use below query;

| rex field=_raw "modelId\s(?<modelId>\d+)"
| stats count by modelId

 

If this reply helps you an upvote is appreciated.

If this reply helps you an upvote and "Accept as Solution" is appreciated.

iqbalintouch
Path Finder

Hi @scelikok ,
thank you, I was looking for this thing exactly. Sorry for the late reply 🙂

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...