<?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: Multiple stats for multiple key-values with a common prefix in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209800#M176655</link>
    <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | table prefix-* | eval temp=1 | untable temp field value | stats median(val) as "Median", perc90(val) as "90th percentile", perc99(val) as "99th percentile", min(val) as "min", max(val) as "max", stdev(val) as "Standard deviation", count(val) as "count" by field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Sep 2016 16:06:41 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-09-22T16:06:41Z</dc:date>
    <item>
      <title>Multiple stats for multiple key-values with a common prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209798#M176653</link>
      <description>&lt;P&gt;We have log entries with multiple key-value pairs. All of the keys I'm interested in have a common prefix and all of the values are decimal numbers. Unfortunately, not every entry contains all of the keys.&lt;BR /&gt;
An entry could look like this:&lt;BR /&gt;
&lt;CODE&gt;&amp;lt;TIMESTAMP, LOGLEVEL etc.&amp;gt; prefix-&amp;lt;SUFFIX1&amp;gt;=&amp;lt;VALUE1&amp;gt;, prefix-&amp;lt;SUFFIX3&amp;gt;=&amp;lt;VALUE2&amp;gt;, ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What I want is a table where the first column contains the union of all of the keys with the common prefix, the other columns should contain statistics like median, different percentiles, standard deviation.&lt;/P&gt;

&lt;P&gt;What I got so far:&lt;BR /&gt;
&lt;CODE&gt;host=... index=... | rex max_match=100 "(?&amp;lt;field&amp;gt;prefix-\w+?)=(?&amp;lt;val&amp;gt;\d+)" | stats median(val) as "Median", perc90(val) as "90th percentile",  perc99(val) as "99th percentile", min(val) as "min", max(val) as "max", stdev(val) as "Standard deviation", count(val) as "count" by field&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The problem: Because not all log entries contain all keys, somewhere along the pipes the value 0 seems to be assumed for those missing keys. As a result, the statistical measures get totally skewed.&lt;/P&gt;

&lt;P&gt;I would be thankful for any help.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 07:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209798#M176653</guid>
      <dc:creator>mfietz</dc:creator>
      <dc:date>2016-09-22T07:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple stats for multiple key-values with a common prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209799#M176654</link>
      <description>&lt;P&gt;&lt;CODE&gt;fieldsummary&lt;/CODE&gt; seems to mostly do what I want, but it is missing percentiles and median&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209799#M176654</guid>
      <dc:creator>mfietz</dc:creator>
      <dc:date>2016-09-22T14:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple stats for multiple key-values with a common prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209800#M176655</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | table prefix-* | eval temp=1 | untable temp field value | stats median(val) as "Median", perc90(val) as "90th percentile", perc99(val) as "99th percentile", min(val) as "min", max(val) as "max", stdev(val) as "Standard deviation", count(val) as "count" by field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 16:06:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209800#M176655</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-22T16:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple stats for multiple key-values with a common prefix</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209801#M176656</link>
      <description>&lt;P&gt;I'm impressed, that solved my issue!&lt;BR /&gt;
Two small corrections: &lt;CODE&gt;table prefix_*&lt;/CODE&gt; (Splunk changes hyphens to underscores when a field is recognized) and &lt;CODE&gt;untable temp field val&lt;/CODE&gt;.&lt;BR /&gt;
But apart from that: Brilliant! Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 06:12:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-stats-for-multiple-key-values-with-a-common-prefix/m-p/209801#M176656</guid>
      <dc:creator>mfietz</dc:creator>
      <dc:date>2016-09-23T06:12:01Z</dc:date>
    </item>
  </channel>
</rss>

