Splunk Search

extract multiple fields(number unknown) and sum it up

Christian
Path Finder

i have several events which look like this one (this is one event, repeating with varios values after Txxxx,)

DISKBUSY,T0012,0.1,0.0,0.1,0.0,0.0,0.5,0.0

DISKREAD,T0012,0.1,0.0,0.0,0.0,0.0,149.4,0.0

DISKWRITE,T0012,9.0,0.1,0.8,0.2,0.0,39.2,0.2

DISKXFER,T0012,2.1,0.0,0.2,0.1,0.0,11.3,0.1

DISKBSIZE,T0012,4.2,4.0,4.0,4.0,0.0,16.7,4.0

I have now two issues the first is i would like to create a new field for example sum_DISKXFER which has the value the sum of the values of the line behind DISKXFER,T0012, which where separated by a "," but the problem is this is not a fix number (depending on the number of disk).

my second issue, to visualize the different disks performance i would like to extract a field for each value for example DISKXFER,T0012,(field1) = 2.1,(field2) = 0.0,(field3) = 0.2,(field4) = 0.1,(field5) = 0.0,(field6) = 11.3,(field7) = 0.1

here i have the same problem this can be different for some hosts. (sure my search will extract only one host which has always the same amount of disk, but the search should work for all hosts)

i hope you understand my strange question, thanks for any help
christian

Tags (2)
0 Karma

woodcock
Esteemed Legend

I don't know of a way to do it as separate field names but it can be done as a multi-value field like this:

... | rex "^[^,]*,[^,]*(?<myField>.*)$ | eval myMvField=split(myField,",")

Then install this:

http://jordan.broughs.net/archives/2012/06/mvsum-for-splunk-summing-multi-valued-fields-within-a-sin...

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...