<?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 check if a field only contains a -z and doesnt contain any other characters using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178559#M51354</link>
    <description>&lt;P&gt;You cannot achieve this using rex. As gkanapathy mentioned use eval.&lt;/P&gt;

&lt;P&gt;What you need is len, ltrim, tonumber functions&lt;/P&gt;</description>
    <pubDate>Tue, 12 Aug 2014 05:43:20 GMT</pubDate>
    <dc:creator>strive</dc:creator>
    <dc:date>2014-08-12T05:43:20Z</dc:date>
    <item>
      <title>How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178555#M51350</link>
      <description>&lt;P&gt;How to check if a field only contains a-z and doesn't contain any other character using Rex.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 00:06:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178555#M51350</guid>
      <dc:creator>ishugupta</dc:creator>
      <dc:date>2014-08-12T00:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178556#M51351</link>
      <description>&lt;P&gt;Splunk documentation says - Use the rex command for search-time field extraction or string replacement and character substitution.&lt;/P&gt;

&lt;P&gt;Could you post your inputs and expected output.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 02:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178556#M51351</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-12T02:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178557#M51352</link>
      <description>&lt;P&gt;The &lt;CODE&gt;rex&lt;/CODE&gt; command doesn't check anything, it extracts fields from data. Even if you had a command that "checked", what do you want it to do? How you need Splunk to tell you, or what you you need Splunk to do on the basis of that information? Perhaps you need to look at &lt;CODE&gt;eval&lt;/CODE&gt; &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 03:55:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178557#M51352</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-08-12T03:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178558#M51353</link>
      <description>&lt;P&gt;Thanks pablo... I simply need to put a condition on a variable ,to make sure that it only has characters.&lt;BR /&gt;
I want to break my flow in case it contains null/numbers or spaces only.&lt;BR /&gt;
For example my string is "This is a String"&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 04:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178558#M51353</guid>
      <dc:creator>ishugupta</dc:creator>
      <dc:date>2014-08-12T04:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178559#M51354</link>
      <description>&lt;P&gt;You cannot achieve this using rex. As gkanapathy mentioned use eval.&lt;/P&gt;

&lt;P&gt;What you need is len, ltrim, tonumber functions&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 05:43:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178559#M51354</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-12T05:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178560#M51355</link>
      <description>&lt;P&gt;thanks..strive..&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 05:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178560#M51355</guid>
      <dc:creator>ishugupta</dc:creator>
      <dc:date>2014-08-12T05:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178561#M51356</link>
      <description>&lt;P&gt;Try this and see if this is sufficient&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Search... | eval FieldType = typeof(YOUR FIELD)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Aug 2014 05:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178561#M51356</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-12T05:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a field only contains a -z and doesnt contain any other characters using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178562#M51357</link>
      <description>&lt;P&gt;What about &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | regex field_to_check="^[a-zA-Z]+$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You mention breaking if those conditions aren't met but I'm wondering if you bake this into an append or join it would potentially be more useful. This approach would make the regex something like a where statement. Maybe something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | join type=left &amp;lt;join_field&amp;gt; [search blahblahblah | regex &amp;lt;join_field&amp;gt;="^[a-zA-Z]+$" | eval string_check = "woohoo I'm a string!" | table &amp;lt;join_field&amp;gt; string_check] | fillnull string_check value="I contain illegal characters" | table  &amp;lt;fields of interest&amp;gt; string_check
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The advantage of this approach is that it doesn't totally break/stop the query if the field does contain numbers. If you take out the type=left in the join you will only move forward with values where there are matches at which point you might as well use the regex approach.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 11:26:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-only-contains-a-z-and-doesnt-contain-any/m-p/178562#M51357</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2014-08-13T11:26:19Z</dc:date>
    </item>
  </channel>
</rss>

