<?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: Check for only non-numeric value in an extracted field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26650#M177673</link>
    <description>&lt;P&gt;I'll have to learn to finish my answer and hit that "post your answer" button.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2011 21:46:42 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2011-12-01T21:46:42Z</dc:date>
    <item>
      <title>Check for only non-numeric value in an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26647#M177670</link>
      <description>&lt;P&gt;I have following string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2011-12-01T13:31:25-05:0063487210, TEST# 67779806
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have written the following search string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="source" source="Out.log" "TEST# "| rex "TEST# (?&amp;lt;test_no&amp;gt;\t+) "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to check if "&lt;STRONG&gt;TEST#&lt;/STRONG&gt;" contains any non-numeric values (&lt;STRONG&gt;TEST&lt;/STRONG&gt;# must contain all numeric field so that the child applications work properly. Child applications can't handle non-numeric value in TEST# field).&lt;/P&gt;

&lt;P&gt;How can I check and alert incase there is some non-numeric value in TEST# field.&lt;/P&gt;

&lt;P&gt;Please advice.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 18:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26647#M177670</guid>
      <dc:creator>anirbanukil</dc:creator>
      <dc:date>2011-12-01T18:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Check for only non-numeric value in an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26648#M177671</link>
      <description>&lt;P&gt;I don't get the &lt;CODE&gt;test_no&lt;/CODE&gt; extraction. It seems to match one or more tabs after TEST#? Typo?&lt;/P&gt;

&lt;P&gt;Anyway regarding the question, how to check if a field has numeric content only: either use &lt;CODE&gt;regex&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | regex test_no="^\d+$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or &lt;CODE&gt;where&lt;/CODE&gt; with the function &lt;CODE&gt;isnum&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where isnum(test_no)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2011 20:29:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26648#M177671</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-12-01T20:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Check for only non-numeric value in an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26649#M177672</link>
      <description>&lt;P&gt;Have you looked at &lt;CODE&gt;eval&lt;/CODE&gt; or &lt;CODE&gt;where&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;There is a function for &lt;CODE&gt;eval&lt;/CODE&gt; (and &lt;CODE&gt;where&lt;/CODE&gt;) which is called &lt;CODE&gt;isnum(X)&lt;/CODE&gt;, which may may be what you need.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Where"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Where&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;hope this helps,&lt;/P&gt;

&lt;P&gt;/kristian&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 20:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26649#M177672</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-12-01T20:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Check for only non-numeric value in an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26650#M177673</link>
      <description>&lt;P&gt;I'll have to learn to finish my answer and hit that "post your answer" button.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 21:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26650#M177673</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-12-01T21:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Check for only non-numeric value in an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26651#M177674</link>
      <description>&lt;P&gt;Thanks a lot for the answer. I was able to solve the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 22:38:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26651#M177674</guid>
      <dc:creator>anirbanukil</dc:creator>
      <dc:date>2011-12-01T22:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Check for only non-numeric value in an extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26652#M177675</link>
      <description>&lt;P&gt;That's good.  Please use the "accept answer" checkbox next to one of the answers to accept it and mark the question as "answered".&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 23:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Check-for-only-non-numeric-value-in-an-extracted-field/m-p/26652#M177675</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2011-12-01T23:54:57Z</dc:date>
    </item>
  </channel>
</rss>

