<?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 How do I get top values based on eval? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411346#M118664</link>
    <description>&lt;P&gt;I have a relatively simple query with which I am evaluating a new field.  I'd like to get the top values of this new field however the results are not what I expect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Base Query:
index=lisum_data vendord=*  user_hash=* featurename=*  
| stats count by user_hash
| eval TimeUsed=count*10/60
| where TimeUsed &amp;gt; .5
| sort TimeUsed desc
| fields - count

Attempted:
index=lisum_data vendord=*  user_hash=* featurename=*  
| stats count by user_hash
| eval TimeUsed=count*10/60
| where TimeUsed &amp;gt; .5
| sort TimeUsed desc
| fields - count
| top limit=25 TimeUsed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want a table of the top 25 users (user_hash) by total time used(TimeUsed)&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 20:04:02 GMT</pubDate>
    <dc:creator>jackpal</dc:creator>
    <dc:date>2018-10-08T20:04:02Z</dc:date>
    <item>
      <title>How do I get top values based on eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411346#M118664</link>
      <description>&lt;P&gt;I have a relatively simple query with which I am evaluating a new field.  I'd like to get the top values of this new field however the results are not what I expect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Base Query:
index=lisum_data vendord=*  user_hash=* featurename=*  
| stats count by user_hash
| eval TimeUsed=count*10/60
| where TimeUsed &amp;gt; .5
| sort TimeUsed desc
| fields - count

Attempted:
index=lisum_data vendord=*  user_hash=* featurename=*  
| stats count by user_hash
| eval TimeUsed=count*10/60
| where TimeUsed &amp;gt; .5
| sort TimeUsed desc
| fields - count
| top limit=25 TimeUsed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want a table of the top 25 users (user_hash) by total time used(TimeUsed)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 20:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411346#M118664</guid>
      <dc:creator>jackpal</dc:creator>
      <dc:date>2018-10-08T20:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get top values based on eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411347#M118665</link>
      <description>&lt;P&gt;Your sort command should be   &lt;CODE&gt;sort 0 - TimeUsed&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 20:20:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411347#M118665</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-10-08T20:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get top values based on eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411348#M118666</link>
      <description>&lt;P&gt;Hey ! &lt;BR /&gt;
You were really closed, try that :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=lisum_data vendord=*  user_hash=* featurename=*  
 | stats count by user_hash
 | eval TimeUsed=count*10/60
 | where TimeUsed &amp;gt; .5
 | sort 25 -TimeUsed
 | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Kail&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 20:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-top-values-based-on-eval/m-p/411348#M118666</guid>
      <dc:creator>KailA</dc:creator>
      <dc:date>2018-10-08T20:55:16Z</dc:date>
    </item>
  </channel>
</rss>

