mvsum for Splunk: Summing multi-valued fields within a single event

Here's a way to sum up multi-valued fields within events in Splunk.

Splunk provides "mvcount" and "mvjoin" but doesn't provide anything like "mvsum". So I wrote a custom search command (splunk reference docs here) that can be plugged into Splunk to provide functionality like this:

* | rex max_match=10 "(?<nums>\d+)" | mvsum nums as total_nums | table nums total_nums

Which generates output like this:

Installation is as easy as installing this source code and restarting Splunk. Tested on Splunk 4.3.2.