Splunk Search

Combining fields with mvcombine

jravida
Communicator

Hi folks,

I'm trying to merge events that share a common keyword value, with the mvcombine. The problem is it just lists the same value multiple times; I want it to add them up.

The search is relatively normal, but cumbersome to put here, so I will post just a bit:

... | table HOST percentcomplete | mvcombine percentcomplete | sort HOST

It combines the fields but outputs them as:

exch-svr-04 1.45
1.45
1.45
1.45
1.45
1.45
1.45
1.45
exch-svr-54 2.54
2.54
2.54
2.54
2.54
2.54

I want it to just add up those columns. Is there a simple way to do this?

Edit: I looked at some more results and it looks like my implementation of the mvcombine is also mergin my hosts. So I may be going about this the wrong way.

Tags (2)
0 Karma

wpreston
Motivator

How about

... | stats sum(percentcomplete) by HOST | sort HOST

instead of

... | table HOST percentcomplete | mvcombine percentcomplete | sort HOST
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...