<?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 filter numeric field with where clause? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190096#M54734</link>
    <description>&lt;P&gt;Hi fgysin,&lt;/P&gt;

&lt;P&gt;you can use the filter in your base search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eventtype="app" dT&amp;lt;3600000 | timechart avg(dT)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 21 Aug 2014 12:43:08 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-08-21T12:43:08Z</dc:date>
    <item>
      <title>How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190095#M54733</link>
      <description>&lt;P&gt;So, our application logs duration times of logged method calls as &lt;CODE&gt;..dT=XXXms..&lt;/CODE&gt; and I would like to use this for nice splunk graphs.&lt;/P&gt;

&lt;P&gt;This works brilliantly if I use a query like this (in advanced charting view)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype="app" dT | timechart avg(dT)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Problem is, that the application rarely logs absurdly high duration times going up to several years - clearly a bug of the logging framework we are using.&lt;/P&gt;

&lt;P&gt;These high dT values sadly totally screw up my nice timechart graphs, and mess with statistics. How can I filter out these values?&lt;BR /&gt;
I already tried filtering those log statements using a &lt;CODE&gt;where&lt;/CODE&gt; clause, but so far this has not worked for me - result set stays empty.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype="app" dT | where dT&amp;lt;3600000 | timechart avg(dT)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 12:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190095#M54733</guid>
      <dc:creator>fgysin</dc:creator>
      <dc:date>2014-08-21T12:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190096#M54734</link>
      <description>&lt;P&gt;Hi fgysin,&lt;/P&gt;

&lt;P&gt;you can use the filter in your base search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eventtype="app" dT&amp;lt;3600000 | timechart avg(dT)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 12:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190096#M54734</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-08-21T12:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190097#M54735</link>
      <description>&lt;P&gt;Hmm, that does not work for me... The is graph still plotting average values which lie in the millions and billions.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 12:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190097#M54735</guid>
      <dc:creator>fgysin</dc:creator>
      <dc:date>2014-08-21T12:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190098#M54736</link>
      <description>&lt;P&gt;take this run everywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal earliest=-2h@h latest=-1h@h kb | where kb&amp;lt;128 | stats count
 index=_internal earliest=-2h@h latest=-1h@h kb&amp;lt;128 | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;both will return the same count. Is this dT field numeric or a string?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 12:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190098#M54736</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-08-21T12:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190099#M54737</link>
      <description>&lt;P&gt;ahh I see, your field is like dT=XXXms ... so remove the &lt;CODE&gt;ms&lt;/CODE&gt; first and then you can filter &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 12:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190099#M54737</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-08-21T12:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190100#M54738</link>
      <description>&lt;P&gt;Ah I see. So how would I remove the ms? With the &lt;CODE&gt;rex&lt;/CODE&gt; command?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 13:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190100#M54738</guid>
      <dc:creator>fgysin</dc:creator>
      <dc:date>2014-08-21T13:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190101#M54739</link>
      <description>&lt;P&gt;eventtype="app" dT | eval dT = tonumber(substr(dT,0,len(dT)-2)) | where dT&amp;lt;3600000 | timechart avg(dT)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 13:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190101#M54739</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-21T13:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter numeric field with where clause?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190102#M54740</link>
      <description>&lt;P&gt;Awesome stuff, much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2014 14:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-numeric-field-with-where-clause/m-p/190102#M54740</guid>
      <dc:creator>fgysin</dc:creator>
      <dc:date>2014-08-21T14:00:55Z</dc:date>
    </item>
  </channel>
</rss>

