<?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: Using a rex value in where statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88828#M22750</link>
    <description>&lt;P&gt;I think the issue is with your "where" clause:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where EUORCABS=eu
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is evaluating the values of fields EUORCABS and eu.  That's not what you want to do.&lt;/P&gt;

&lt;P&gt;Either use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where EUORCABS="eu"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | search EUORCABS=eu
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Mar 2012 17:26:07 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2012-03-09T17:26:07Z</dc:date>
    <item>
      <title>Using a rex value in where statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88826#M22748</link>
      <description>&lt;P&gt;Hey everyone. In my data's filename there is an indicator which indicates the type of data that it is. It can either be "eu" or "cabs."&lt;BR /&gt;
I am currently running into issues with this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cms| rex field=source "/home/cemp/CEMP/(?&amp;lt;EUORCABS&amp;gt;eu|cabs)/.*"|where EUORCABS=eu
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It won't run. I have verified that the EUORCABS column is successfully created by running this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cms| rex field=source "/home/cemp/CEMP/(?&amp;lt;EUORCABS&amp;gt;eu|cabs)/.*"|table EUORCABS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All records have either a value of "eu" or "cabs" (without quotes). I have also tried casting it to a string, but no luck.&lt;/P&gt;

&lt;P&gt;Am I missing something obvious here, or is splunk not searching properly?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2012 16:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88826#M22748</guid>
      <dc:creator>msarro</dc:creator>
      <dc:date>2012-03-09T16:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using a rex value in where statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88827#M22749</link>
      <description>&lt;P&gt;Hmm..&lt;/P&gt;

&lt;P&gt;have you tried a stats values(EUORCABS) AS &lt;NEWFIELD&gt; and then tried the where on that field?&lt;/NEWFIELD&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2012 17:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88827#M22749</guid>
      <dc:creator>Kate_Lawrence-G</dc:creator>
      <dc:date>2012-03-09T17:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using a rex value in where statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88828#M22750</link>
      <description>&lt;P&gt;I think the issue is with your "where" clause:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where EUORCABS=eu
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is evaluating the values of fields EUORCABS and eu.  That's not what you want to do.&lt;/P&gt;

&lt;P&gt;Either use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where EUORCABS="eu"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | search EUORCABS=eu
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Mar 2012 17:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-rex-value-in-where-statement/m-p/88828#M22750</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2012-03-09T17:26:07Z</dc:date>
    </item>
  </channel>
</rss>

