Splunk Search

Average time in multivalue field

Walter_Oesch
Observer

Hello
I have a two multivalue fields: poiMv (point of interest) and timeMv as a result of a transaction command. Both Mv-fields have the same size. Same index have corresponding values. poiMv holds the place an event occurred, timeMv the corresponding time.  poiMv holds non unique values, e.g. [start nonrelevant end nonrelevent nonrelevant start end nonrelevant start nonrelevant end].   Now I want to find the time differences of all successiv start and end events. Out of these time differences, I want to calculate the mean value. 

The mean value along with other values should then be presented in a table

Conceptually, the query should looks like this:
| index=myIndex
| where filter
| transaction correlationField mvlist="poiMv timeMv " 
| "find successiv start end pairs in poiMv, calculate time difference, take the mean"

| eval meanStartEnd = ....
| table column1 column2 meanStartEnd 

Any help is welcomed.

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

First suggestion would be to not use transaction - there are other ways of correlating events whilst maintaining time order, from which you can determine time difference and averages.

This would be easier to answer if you could provide some sample anonymised events so we can see what you are dealing with and set up some suggested solutions based on your (dummy) data.

Walter_Oesch
Observer

Thank you for your reply. I managed to find a solution. I use transaction to correlate events with different keys (in the pseudo code example only one field was used).

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...