Getting Data In

Getting A Specific Field From a Log

luteixeira
Explorer

Hello Splunkers. 🙂

I have a stream of logs going to Splunk that reports daily errors. The logs is as follows:

 

Exceptions Details
App...............: WebApp
Original Message..: The provided anti-forgery token was meant for user "1234" but the current user is "".
Server............: WebAppServer
Service API URL...: https://xpto.systemname.com/WebAppApi/SelfService/FI.API.SelfService

 

I have these kinds of exceptions going on through the day and night and my main goal is to compile the type of exception, which URL happened, where (server name) and how many times it happened.

So what I need is to extract the field after the : 

I've tried...

 

index="MyIndex" | extract kvdelim=":", auto=f

 

... as suggested in this cheat sheet but I couldn't manage to work.

Any help/suggestions? 🙂

Thank you in advance.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| rex max_match=0 "(?<key>[^\.:\n]+).*:\s(?<value>[^\n]*)"

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex max_match=0 "(?<key>[^\.:\n]+).*:\s(?<value>[^\n]*)"
0 Karma

luteixeira
Explorer

@ITWhisperer You're awesome! 

Worked just fine for what I was looking for.

Thank you very much!

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...