<?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 find the most prevalent values for a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82358#M20920</link>
    <description>&lt;P&gt;"wdd-d{4}-d{6}" format?&lt;/P&gt;

&lt;P&gt;Yes.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2013 17:31:51 GMT</pubDate>
    <dc:creator>bigtyma</dc:creator>
    <dc:date>2013-01-09T17:31:51Z</dc:date>
    <item>
      <title>How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82355#M20917</link>
      <description>&lt;P&gt;&lt;CODE&gt;Title                   Position        Security_Template&lt;BR /&gt;
NonEE - Volunteer   F01-7121-600002 IP VIEW ONLY CLINICAL&lt;BR /&gt;
NonEE - Volunteer   F01-7121-600002 FRONT DESK AND IP ORDERS CLERK&lt;BR /&gt;
NonEE - Volunteer   F01-7121-600002 IP VIEW ONLY CLINICAL&lt;BR /&gt;
NonEE - Volunteer   F01-7121-600002 IP VIEW ONLY CLINICAL&lt;BR /&gt;
NonEE - Volunteer   F01-7121-600002 ELINK VIEW-ONLY CLINICAL&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Using the example above, I would like to have a report listing the most frequent or most common value of 'Security_Template' for every Position. In the example above the most prevalent would be 'IP VIEW-ONLY' &lt;/P&gt;

&lt;P&gt;Bonus point is if we can list the percentage of records that have each value.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 16:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82355#M20917</guid>
      <dc:creator>bigtyma</dc:creator>
      <dc:date>2013-01-09T16:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82356#M20918</link>
      <description>&lt;P&gt;The data is not easy to split into fields because of the number of spaces. Will the position column always be in the  "\w\d\d-\d{4}-\d{6}" format?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 16:53:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82356#M20918</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-01-09T16:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82357#M20919</link>
      <description>&lt;P&gt;You will need to extract the field first. Here is a quick example that might work:&lt;/P&gt;

&lt;P&gt;source = .... | rex field=_raw "-\d+\s+(?&lt;SECURITY_TEMPLATE&gt;[^\n]+) | stats count by Security_Template | sort -count&lt;/SECURITY_TEMPLATE&gt;&lt;/P&gt;

&lt;P&gt;If you want it by percentage then use the "top" search command. &lt;/P&gt;

&lt;P&gt;source = .... | rex field=_raw "-\d+\s+(?&lt;SECURITY_TEMPLATE&gt;[^\n]+) | top Security_Template&lt;/SECURITY_TEMPLATE&gt;&lt;/P&gt;

&lt;P&gt;If this is a CSV file with a header then you might be able to set the CHECK_FOR_HEADER in the props.conf file. Here is a link to more information:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/admin/Propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/admin/Propsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:04:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82357#M20919</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2020-09-28T13:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82358#M20920</link>
      <description>&lt;P&gt;"wdd-d{4}-d{6}" format?&lt;/P&gt;

&lt;P&gt;Yes.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 17:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82358#M20920</guid>
      <dc:creator>bigtyma</dc:creator>
      <dc:date>2013-01-09T17:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82359#M20921</link>
      <description>&lt;P&gt;Thank you for replying, unfortunately I did not get the results I was hoping for. Security_Template is already extracted.&lt;/P&gt;

&lt;P&gt;In this scenario I should see&lt;/P&gt;

&lt;P&gt;PositionID        SecurityTemplate        Percentage &lt;BR /&gt;
F01-7121-600002   IP VIEW ONLY CLINICAL   50%&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 17:40:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82359#M20921</guid>
      <dc:creator>bigtyma</dc:creator>
      <dc:date>2013-01-09T17:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82360#M20922</link>
      <description>&lt;P&gt;Thank you for replying, unfortunately I did not get the results I was hoping for. Security_Template is already extracted.&lt;/P&gt;

&lt;P&gt;In this scenario I should see&lt;/P&gt;

&lt;P&gt;PositionID        SecurityTemplate        Percentage &lt;BR /&gt;
F01-7121-600002   IP VIEW ONLY CLINICAL   50%&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 17:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82360#M20922</guid>
      <dc:creator>bigtyma</dc:creator>
      <dc:date>2013-01-09T17:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82361#M20923</link>
      <description>&lt;P&gt;If the field is already extracted then you can run the "top" command. Here is a quick example:&lt;/P&gt;

&lt;P&gt;source=... | top Security_Template, PositionID &lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 18:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82361#M20923</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2013-01-09T18:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the most prevalent values for a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82362#M20924</link>
      <description>&lt;P&gt;woohoo! this works. I had to to change it slightly to ' | top Security_Template by PositionID&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2013 18:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-most-prevalent-values-for-a-field/m-p/82362#M20924</guid>
      <dc:creator>bigtyma</dc:creator>
      <dc:date>2013-01-09T18:47:55Z</dc:date>
    </item>
  </channel>
</rss>

