Splunk Search

## How to summarize a lot of fields with mvappend

New Member

I am trying to find the standard deviation from the postfix log.
I assume the following search sentence.

index=postfix earliest=-50d
| timechart span=1d count by fromaddress
| fields - NULL OTHER _time _span _spandays
| transpose 50
| rename "row " as day
| eval mvfield=mvappend(day1,day2,day3,day4,day5............)
| stats avg(mvfield) as avg stdev(mvfield) as std by column

Is there a way to more easily define day 1 to day 50?
| eval mvfield=mvappend(day1,day2,day3,day4,day5............)

Tags (4)
1 Solution
SplunkTrust

Give this a try

``````index=postfix earliest=-50d
| timechart span=1d count by fromaddress
| fields - NULL OTHER _time _span _spandays
| transpose 50
| rename "row " as day
| eval mvfield=null() | foreach day* [eval mvfield=mvappend(mvfield,'<<FIELD>>')]
| stats avg(mvfield) as avg stdev(mvfield) as std by column
``````
SplunkTrust

Give this a try

``````index=postfix earliest=-50d
| timechart span=1d count by fromaddress
| fields - NULL OTHER _time _span _spandays
| transpose 50
| rename "row " as day
| eval mvfield=null() | foreach day* [eval mvfield=mvappend(mvfield,'<<FIELD>>')]
| stats avg(mvfield) as avg stdev(mvfield) as std by column
``````
SplunkTrust

Also, try this

``````index=postfix earliest=-50d
| timechart span=1d count by fromaddress
| fields - NULL OTHER _time _span _spandays
| stats avg(valuefield) stdev(valuefield) by column
``````
New Member

The answer I was hoping for
Thank you!

Get Updates on the Splunk Community!

#### Adoption of RUM and APM at Splunk

Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

#### March Community Office Hours Security Series Uncovered!

Hello Splunk Community! In March, Splunk Community Office Hours spotlighted our fabulous Splunk Threat ...

#### Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars in April. This post ...