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
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...