<?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: Field Comparison Not Working in Basic Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457574#M172197</link>
    <description>&lt;P&gt;Thanks MuS. I understand that typically 'where' should be used, however am more curious as to why the case I presented does not work. Possibly it is just one of Splunk's many quirks...&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 03:19:08 GMT</pubDate>
    <dc:creator>georgiawebber</dc:creator>
    <dc:date>2019-03-28T03:19:08Z</dc:date>
    <item>
      <title>Field Comparison Not Working in Basic Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457572#M172195</link>
      <description>&lt;P&gt;I have two queries:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=main &lt;BR /&gt;
| eval var1="avalue" &lt;BR /&gt;
| eval var2="avalue"&lt;BR /&gt;
| search var1=var2&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=main &lt;BR /&gt;
| eval var1="avalue" &lt;BR /&gt;
| eval var2="avalue"&lt;BR /&gt;
| search var1="avalue"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;How is it that the second query returns events, whereas the the first returns none? I would think they are essentially doing the same string comparison on the final line?&lt;/P&gt;

&lt;P&gt;Any help would be great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 02:10:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457572#M172195</guid>
      <dc:creator>georgiawebber</dc:creator>
      <dc:date>2019-03-28T02:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field Comparison Not Working in Basic Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457573#M172196</link>
      <description>&lt;P&gt;Hi georgiawebber,&lt;/P&gt;

&lt;P&gt;the second search is searching for the string &lt;CODE&gt;avalue&lt;/CODE&gt; and returns events that contain the field &lt;CODE&gt;var1 = "avalue"&lt;/CODE&gt;. &lt;BR /&gt;
the first search should be a &lt;CODE&gt;where&lt;/CODE&gt; if you want to compare the values of two fields. So like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | where var1 = var2 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 03:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457573#M172196</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-03-28T03:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Field Comparison Not Working in Basic Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457574#M172197</link>
      <description>&lt;P&gt;Thanks MuS. I understand that typically 'where' should be used, however am more curious as to why the case I presented does not work. Possibly it is just one of Splunk's many quirks...&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 03:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457574#M172197</guid>
      <dc:creator>georgiawebber</dc:creator>
      <dc:date>2019-03-28T03:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Field Comparison Not Working in Basic Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457575#M172198</link>
      <description>&lt;P&gt;Exactly for the reasons I told you &lt;CODE&gt;search&lt;/CODE&gt; will search in the &lt;CODE&gt;_raw&lt;/CODE&gt; for a string, while &lt;CODE&gt;where&lt;/CODE&gt; uses eval to compare two values of two fields &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 03:35:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457575#M172198</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-03-28T03:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field Comparison Not Working in Basic Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457576#M172199</link>
      <description>&lt;P&gt;Aye I understand you now - that makes sense. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 03:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Comparison-Not-Working-in-Basic-Search/m-p/457576#M172199</guid>
      <dc:creator>georgiawebber</dc:creator>
      <dc:date>2019-03-28T03:41:35Z</dc:date>
    </item>
  </channel>
</rss>

