<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add average column to timewrap table for multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-average-column-to-timewrap-table-for-multiple-fields/m-p/589647#M205307</link>
    <description>&lt;LI-CODE lang="markup"&gt;| foreach *_s*
    [| eval "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total"=if(isnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'),'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total',if(isnull('&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total'),'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;','&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total'+'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'))
    | eval "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count"=if(isnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'),'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count',if(isnull('&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count'),1,'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count'+1))]
| foreach *_total
    [| eval "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_average"='&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total'/'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count']&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 18 Mar 2022 09:31:39 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-03-18T09:31:39Z</dc:date>
    <item>
      <title>How to add average column to timewrap table for multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-average-column-to-timewrap-table-for-multiple-fields/m-p/589592#M205289</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;
&lt;P&gt;I want to add columns to this table that I copied from the docs about &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Timewrap" target="_blank" rel="noopener"&gt;timewrap&lt;/A&gt;. I want to add columns that have the averages for each field (accessories, sports, strategy, etc.) across the timewrapped columns. Basically, a column for the average of ACCESSORIES_S1, ACCESSORIES_S0, etc., and then a column for the average of SPORTS_S1, SPORTS_S0, etc., and a column for the average of STRATEGY_S1, STRATEGY_S0, etc.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="michaelsplunk1_0-1647551329507.png" style="width: 692px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18570i2B8FBA4E5651C8E1/image-dimensions/692x253?v=v2" width="692" height="253" role="button" title="michaelsplunk1_0-1647551329507.png" alt="michaelsplunk1_0-1647551329507.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;michaelsplunk1_0-1647551329507.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Additionally, I eventually want to use these averages as a trigger for an alert when the counts on these (i.e., accessories, sports, strategy, etc.) surpass the average. Long story short, I have an arbitrary number of fields, with a count on those fields, and I want to alert when the count on those fields exceeds the average, without having to set up multiple alerts for each field because I don't know what the fields are going to be ahead of time and the field names can change.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/160866"&gt;@mattymo&lt;/a&gt;&amp;nbsp;your multipart article on timewrap and &lt;A href="https://www.splunk.com/en_us/blog/platform/cyclical-statistical-forecasts-and-anomalies-part-1.html" target="_blank" rel="noopener"&gt;Cyclical Statistical Forecasts and Anomalies&lt;/A&gt; has helped me so much, can you please help me on this application of timewrap?&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 21:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-average-column-to-timewrap-table-for-multiple-fields/m-p/589592#M205289</guid>
      <dc:creator>michaelsplunk1</dc:creator>
      <dc:date>2022-03-17T21:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add average column to timewrap table for multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-average-column-to-timewrap-table-for-multiple-fields/m-p/589647#M205307</link>
      <description>&lt;LI-CODE lang="markup"&gt;| foreach *_s*
    [| eval "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total"=if(isnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'),'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total',if(isnull('&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total'),'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;','&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total'+'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'))
    | eval "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count"=if(isnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'),'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count',if(isnull('&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count'),1,'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count'+1))]
| foreach *_total
    [| eval "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_average"='&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_total'/'&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;_count']&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Mar 2022 09:31:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-average-column-to-timewrap-table-for-multiple-fields/m-p/589647#M205307</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-18T09:31:39Z</dc:date>
    </item>
  </channel>
</rss>

