<?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: Why am I unable to use comparison operators &amp;quot;greater than or equal to&amp;quot; with a timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161967#M45811</link>
    <description>&lt;P&gt;As @jrodman said, timechart by User does not give you a field named &lt;CODE&gt;la&lt;/CODE&gt; but fields named after each User.  The "as" clause is used for legend only.  I think what you wanted is to find&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Maximum &lt;CODE&gt;value&lt;/CODE&gt; of each &lt;CODE&gt;User&lt;/CODE&gt;;&lt;/LI&gt;
&lt;LI&gt;Round the maximum value to the 2nd decimal place;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;For those users whose maximum value in a given time span is greater than or equal to 10 and only for those, display users and their respective maximum values.&lt;BR /&gt;
Note the above also imply two logical consequences:&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Users whose maximum value has never reached 10 in the entire search period will never be shown.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;For users appearing on the chart, their results will show 0 in spans of time in which their maxima don't reach 10.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;The logic can be reversed to produce the exact same output, i.e., by limiting timechart only to those users who ever showed a value or values reaching or exceeding 10.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where value &amp;gt;= 10 | timechart max(value) as la by User | eval la=round(la,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because you are seeking maxima and not average, where you perform rounding doesn't affect the outcome.  In other words, you can do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where value &amp;gt;= 10 | eval value=round(value,2) | timechart max(value) as la by User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to get the same results although the first form is more efficient.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Oct 2014 21:23:02 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2014-10-14T21:23:02Z</dc:date>
    <item>
      <title>Why am I unable to use comparison operators "greater than or equal to" with a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161965#M45809</link>
      <description>&lt;P&gt;unable to use where &amp;gt;= with timechart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timechart max(value) AS la by User | eval la=round(la,2) | where la &amp;gt;=10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Oct 2014 06:05:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161965#M45809</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2014-10-14T06:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to use comparison operators "greater than or equal to" with a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161966#M45810</link>
      <description>&lt;P&gt;When you say &lt;CODE&gt;max(value) as la by User&lt;/CODE&gt;, you get the values as the value of 'User', not as 'la'.  If you have multiple fields, like &lt;CODE&gt;|timechart max(value) as mv, avg(value) as av by user&lt;/CODE&gt; then you get the values as fields called things like mv:user1 and av:user1.&lt;/P&gt;

&lt;P&gt;Effectively a single &lt;CODE&gt;timechart aggterm as name by field&lt;/CODE&gt; is not a meaningful 'as' scenario, since you would want the data plotted by the field values, and we express the data as a single xyseries.  You can say |where user1 &amp;gt;=10.    I'm not sure how to construct the implied goal, but suspect it involves bringing the eval expression into the timechart.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 06:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161966#M45810</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-10-14T06:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to use comparison operators "greater than or equal to" with a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161967#M45811</link>
      <description>&lt;P&gt;As @jrodman said, timechart by User does not give you a field named &lt;CODE&gt;la&lt;/CODE&gt; but fields named after each User.  The "as" clause is used for legend only.  I think what you wanted is to find&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Maximum &lt;CODE&gt;value&lt;/CODE&gt; of each &lt;CODE&gt;User&lt;/CODE&gt;;&lt;/LI&gt;
&lt;LI&gt;Round the maximum value to the 2nd decimal place;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;For those users whose maximum value in a given time span is greater than or equal to 10 and only for those, display users and their respective maximum values.&lt;BR /&gt;
Note the above also imply two logical consequences:&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Users whose maximum value has never reached 10 in the entire search period will never be shown.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;For users appearing on the chart, their results will show 0 in spans of time in which their maxima don't reach 10.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;The logic can be reversed to produce the exact same output, i.e., by limiting timechart only to those users who ever showed a value or values reaching or exceeding 10.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where value &amp;gt;= 10 | timechart max(value) as la by User | eval la=round(la,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because you are seeking maxima and not average, where you perform rounding doesn't affect the outcome.  In other words, you can do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where value &amp;gt;= 10 | eval value=round(value,2) | timechart max(value) as la by User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to get the same results although the first form is more efficient.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 21:23:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161967#M45811</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2014-10-14T21:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to use comparison operators "greater than or equal to" with a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161968#M45812</link>
      <description>&lt;P&gt;If the span for your timechart is fixed (not using splunk default ) then try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | bucket span=&amp;lt;&amp;lt;yourSpan&amp;gt;&amp;gt; _time | stats max(value) as la by _time user | eval la=round(la,2) | where la &amp;gt;=10 | xyseries _time user la
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | bucket span=&amp;lt;&amp;lt;yourSpan&amp;gt;&amp;gt; _time | stats max(value) as la by _time user | eval la=round(la,2) | where la &amp;gt;=10 | timechart span=&amp;lt;&amp;lt;yourSpan&amp;gt;&amp;gt; max(la) by user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Oct 2014 22:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161968#M45812</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-14T22:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to use comparison operators "greater than or equal to" with a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161969#M45813</link>
      <description>&lt;P&gt;thank you for your response. This is close however..  I have a table which calculates the avg as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats avg(value) AS la BY host User |  eval la=round(la,2) | where la &amp;gt;=0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also as suggested by you i want to display timechart. Tried below but i see entries from below search but not from the table above. Is it because its _time ? (i.e if i see 10 users from timechart, i see only one from the previous table.  both need to match)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats avg(value) as la by _time host User | eval la=round(la,2) | where la &amp;gt;=0 | timechart avg(la) by User
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Oct 2014 00:09:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-use-comparison-operators-quot-greater-than-or/m-p/161969#M45813</guid>
      <dc:creator>kris99</dc:creator>
      <dc:date>2014-10-15T00:09:03Z</dc:date>
    </item>
  </channel>
</rss>

