<?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 create a list of fields in a table with stats displayed on the Selected Fields sidebar, including rare 10 values, their counts, and percentages? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217331#M63844</link>
    <description>&lt;P&gt;This does not give rare values, but it is fast and gives good stats.  Still searching for how to add rare values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| head 99999 | table field1 | fieldsummary | rename count AS count_all | table field count_all values | eval values=replace(values,"\\\\\\\\","\\") | rex field=values max_match=0 "\{(?&amp;lt;values_line&amp;gt;[^,]*,[^,]*)\},?" | fields - values | mvexpand values_line | rex field=values_line max_match=0 "\"value\":\"(?&amp;lt;value&amp;gt;[^\"]*)\",\"count\":(?&amp;lt;count&amp;gt;\d*)" | eval percent=round(count/count_all*100,2) | table field value count percent count_all | head 99 | appendpipe [| stats first(count_all) AS count_all sum(count) AS count first(field) AS field | eval percent=round(count/count_all*100,2) | eval value="top 100 values" | fields - count_all ] | fields - count_all | sort 0 - percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Sep 2015 16:26:14 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2015-09-09T16:26:14Z</dc:date>
    <item>
      <title>How to create a list of fields in a table with stats displayed on the Selected Fields sidebar, including rare 10 values, their counts, and percentages?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217328#M63841</link>
      <description>&lt;P&gt;I want to take a list of fields and show the stats displayed on the Selected fields sidebar in a table.&lt;/P&gt;

&lt;P&gt;When we do a search, on the left side there is a Selected Fields section.  When we click on a field, we see stats on that field, including:&lt;BR /&gt;
Percent of events overall&lt;BR /&gt;
Top 10 values and their counts and percents&lt;/P&gt;

&lt;P&gt;I would like to put these into a table for each field specified (not just top), and other stats too.&lt;/P&gt;

&lt;P&gt;I am also interested in other stats for each field:&lt;BR /&gt;
Rare 10 values and their counts and percents&lt;BR /&gt;
Values which deviate from the standard pattern&lt;/P&gt;

&lt;P&gt;Table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Type Field Value Count %
All user ALL 99 99%
Top 1 user abc 12 12%
Top 2 ...
Bottom 1 user xyz 13 13%
All dest ALL 98 98%
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Maybe it will involve append using top and rare, or perhaps fieldsummary? but is it possible to use eventstats? like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table field1 field2 |  eventstats count percent by *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;fieldsummary has no percent and the values are not well formatted.  Plus, there are a lot of extra fields there as well. Perhaps I need to manually format it or are there functions which assist with the formatting and rendering of the data?  It also does not seem to show rare values.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 14:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217328#M63841</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-09-09T14:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of fields in a table with stats displayed on the Selected Fields sidebar, including rare 10 values, their counts, and percentages?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217329#M63842</link>
      <description>&lt;P&gt;Maybe:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| anomalousvalue action=filter field1 field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to find the anomalous values but it does not compute counts and percentages.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 14:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217329#M63842</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-09-09T14:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of fields in a table with stats displayed on the Selected Fields sidebar, including rare 10 values, their counts, and percentages?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217330#M63843</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=myindex | table field1 | appendpipe [| top field1 | eval category="top" ] | appendpipe [| rare field1 | eval category="rare" ] | appendpipe [| stats sum(count) AS count | eval field1="all" | eval percent=100 | eval category="all"] | search category=*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Sep 2015 15:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217330#M63843</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-09-09T15:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a list of fields in a table with stats displayed on the Selected Fields sidebar, including rare 10 values, their counts, and percentages?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217331#M63844</link>
      <description>&lt;P&gt;This does not give rare values, but it is fast and gives good stats.  Still searching for how to add rare values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| head 99999 | table field1 | fieldsummary | rename count AS count_all | table field count_all values | eval values=replace(values,"\\\\\\\\","\\") | rex field=values max_match=0 "\{(?&amp;lt;values_line&amp;gt;[^,]*,[^,]*)\},?" | fields - values | mvexpand values_line | rex field=values_line max_match=0 "\"value\":\"(?&amp;lt;value&amp;gt;[^\"]*)\",\"count\":(?&amp;lt;count&amp;gt;\d*)" | eval percent=round(count/count_all*100,2) | table field value count percent count_all | head 99 | appendpipe [| stats first(count_all) AS count_all sum(count) AS count first(field) AS field | eval percent=round(count/count_all*100,2) | eval value="top 100 values" | fields - count_all ] | fields - count_all | sort 0 - percent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Sep 2015 16:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-list-of-fields-in-a-table-with-stats-displayed/m-p/217331#M63844</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-09-09T16:26:14Z</dc:date>
    </item>
  </channel>
</rss>

