Splunk Search

How do I extract the following fields using the rex command?

maheshsat
Explorer

I want to extract Balance (Entered)="10008.1311701944" and Balance (Functional)="11648.1319999944" fields from below logs

Log:

GL Test="000000", GL Test2="0000", Balance Type="Debit", Balance (Entered)="10008.1311701944", Balance (Functional)="11648.1311701944"

Command:

index=test sourcetype="test" | rex field=_raw ".*\w+\s+\w+\=\"\d+\.\d+\"\s+[?\w+\s+\w+\"\d+\"\,\s+\w+]\s+\w+.*"
0 Karma
1 Solution

burwell
SplunkTrust
SplunkTrust

Hello.

How about

<your search...> | rex "Balance \(Entered\)=\"(?<balance_entered>[^\"]+).+Balance \(Functional\)\=\"(?<balance_functional>[^\"]+)"

By the way I used the website regex101.com to debug this

View solution in original post

0 Karma

burwell
SplunkTrust
SplunkTrust

Hello.

How about

<your search...> | rex "Balance \(Entered\)=\"(?<balance_entered>[^\"]+).+Balance \(Functional\)\=\"(?<balance_functional>[^\"]+)"

By the way I used the website regex101.com to debug this

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...