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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...