<?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 filter string values from a greater-than-or-equal-to numerical comparison? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-filter-string-values-from-a-greater-than-or-equal-to/m-p/468446#M131900</link>
    <description>&lt;P&gt;I have a field in my query called &lt;CODE&gt;Attempt&lt;/CODE&gt; that is either a non-negative integer or a special value "null". I use the special "null" string value because I am creating a summary query and don't want to lose events for which fields aren't present. I therefore use the &lt;CODE&gt;fillnull&lt;/CODE&gt; operator that you can see in the query below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="fraud" sourcetype=strategy-engine ActivityStep=rs
| rex field=_raw "\"rescoreAttemptNumber\":\"(?&amp;lt;Attempt&amp;gt;\d*)\"},"
| rex field=_raw "\"riskRecommendationQuality\":{\"status\":\"(?&amp;lt;Strength&amp;gt;\w*)\","
| fillnull value=null ActivityName Attempt IrisRoutingKey OperationName ProductName Strength
| stats count by ActivityName,Attempt,IrisRoutingKey,OperationName,ProductName,Strength
| search (OperationName=compute OR OperationName=executeRuleSet) AND Attempt&amp;gt;= 10 AND Strength="DEGRADED"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My problem is really the &lt;CODE&gt;Attempt&amp;gt;=10&lt;/CODE&gt; term because I see both "null" and "10" values in my results table. My table returned is the table below:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7854i47898FF39B0990D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Ideally, I would like to filter such results where &lt;CODE&gt;Attempt=null&lt;/CODE&gt; without using the term &lt;CODE&gt;Attempt&amp;gt;=10 AND Attempt!=null&lt;/CODE&gt; because the first part of the query (up to and including the &lt;CODE&gt;stats&lt;/CODE&gt; operator) is actually a new general-purpose summary query. I suspect that people using this summary query will often forget to use the &lt;CODE&gt;Attempt!="null"&lt;/CODE&gt; and just end up with extraneous results if I require them to use this term.&lt;/P&gt;

&lt;P&gt;Is there any way to get Splunk to filter out non-numerical values from a &lt;CODE&gt;LHS&amp;gt;=RHS&lt;/CODE&gt; style-comparison? Your help would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 21:58:18 GMT</pubDate>
    <dc:creator>entpnerd</dc:creator>
    <dc:date>2019-10-30T21:58:18Z</dc:date>
    <item>
      <title>How do I filter string values from a greater-than-or-equal-to numerical comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-filter-string-values-from-a-greater-than-or-equal-to/m-p/468446#M131900</link>
      <description>&lt;P&gt;I have a field in my query called &lt;CODE&gt;Attempt&lt;/CODE&gt; that is either a non-negative integer or a special value "null". I use the special "null" string value because I am creating a summary query and don't want to lose events for which fields aren't present. I therefore use the &lt;CODE&gt;fillnull&lt;/CODE&gt; operator that you can see in the query below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="fraud" sourcetype=strategy-engine ActivityStep=rs
| rex field=_raw "\"rescoreAttemptNumber\":\"(?&amp;lt;Attempt&amp;gt;\d*)\"},"
| rex field=_raw "\"riskRecommendationQuality\":{\"status\":\"(?&amp;lt;Strength&amp;gt;\w*)\","
| fillnull value=null ActivityName Attempt IrisRoutingKey OperationName ProductName Strength
| stats count by ActivityName,Attempt,IrisRoutingKey,OperationName,ProductName,Strength
| search (OperationName=compute OR OperationName=executeRuleSet) AND Attempt&amp;gt;= 10 AND Strength="DEGRADED"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My problem is really the &lt;CODE&gt;Attempt&amp;gt;=10&lt;/CODE&gt; term because I see both "null" and "10" values in my results table. My table returned is the table below:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7854i47898FF39B0990D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Ideally, I would like to filter such results where &lt;CODE&gt;Attempt=null&lt;/CODE&gt; without using the term &lt;CODE&gt;Attempt&amp;gt;=10 AND Attempt!=null&lt;/CODE&gt; because the first part of the query (up to and including the &lt;CODE&gt;stats&lt;/CODE&gt; operator) is actually a new general-purpose summary query. I suspect that people using this summary query will often forget to use the &lt;CODE&gt;Attempt!="null"&lt;/CODE&gt; and just end up with extraneous results if I require them to use this term.&lt;/P&gt;

&lt;P&gt;Is there any way to get Splunk to filter out non-numerical values from a &lt;CODE&gt;LHS&amp;gt;=RHS&lt;/CODE&gt; style-comparison? Your help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 21:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-filter-string-values-from-a-greater-than-or-equal-to/m-p/468446#M131900</guid>
      <dc:creator>entpnerd</dc:creator>
      <dc:date>2019-10-30T21:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I filter string values from a greater-than-or-equal-to numerical comparison?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-filter-string-values-from-a-greater-than-or-equal-to/m-p/468447#M131901</link>
      <description>&lt;P&gt;@entpnerd ,&lt;/P&gt;

&lt;P&gt;Try using &lt;CODE&gt;where&lt;/CODE&gt; for comparison which should filter out the result  &amp;gt;=10 ignoring the null&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 03:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-filter-string-values-from-a-greater-than-or-equal-to/m-p/468447#M131901</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-10-31T03:22:47Z</dc:date>
    </item>
  </channel>
</rss>

