All Apps and Add-ons

Extract multiple values of same field

sriva6
New Member

Hi,

I have logs as shown below:

03 December 2013 03:00:23
Capacity of vmware farm
@{Name=sdlc_stg_win_01; FreeSpaceGB=615.4912109375; CapacityGB=2800}
@{Name=sdlc_stg_win_02; FreeSpaceGB=272.9287109375; CapacityGB=2800}
03 December 2013 01:00:26
Capacity of vmware farm
@{Name=sdlc_stg_win_01; FreeSpaceGB=613.2490234375; CapacityGB=2800}
@{Name=sdlc_stg_win_02; FreeSpaceGB=322.607421875; CapacityGB=2800}
02 December 2013 23:00:20
Capacity of vmware farm
@{Name=sdlc_stg_win_01; FreeSpaceGB=614.712890625; CapacityGB=2800}
@{Name=sdlc_stg_win_02; FreeSpaceGB=334.740234375; CapacityGB=2800}
02 December 2013 21:00:19
Capacity of vmware farm
@{Name=sdlc_stg_win_01; FreeSpaceGB=614.712890625; CapacityGB=2800}
@{Name=sdlc_stg_win_02; FreeSpaceGB=355.515625; CapacityGB=2800}
02 December 2013 19:00:37
Capacity of vmware farm
@{Name=sdlc_stg_win_01; FreeSpaceGB=619.689453125; CapacityGB=2800}
@{Name=sdlc_stg_win_02; FreeSpaceGB=365.21484375; CapacityGB=2800}
02 December 2013 10:29:37
Capacity of vmware farm
@{Name=sdlc_stg_win_01; FreeSpaceGB=643.68359375; CapacityGB=2800}
@{Name=sdlc_stg_win_02; FreeSpaceGB=463.99609375; CapacityGB=2800}

I want to extract FreeSpaceGB for both my storage volumes sdlc_stg_win_01 and sdlc_stg_win_02. I am able to extract the FreeSpaceGb for the first volume using the field extracter but not the second one. Please help.

0 Karma

linu1988
Champion

why dont you extract Name=sdlc_stg_win_01; FreeSpaceGB=614.712890625 then split them and get the required value. Moreover i think splunk should be extracting them on it's own.

0 Karma

somesoni2
Revered Legend

Try this

|  rex max_match=0 "(?m)Name=(?<DriveName>[^;]+)" 
|  rex max_match=0 "(?m)FreeSpaceGB=(?<FreeSpace>[^;]+)" 
|  rex max_match=0 "(?m)CapacityGB=(?<TotalCapacity>[^}]+)"
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...