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>[^}]+)"
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...