<?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: Matching showing incorrect values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493411#M137633</link>
    <description>&lt;P&gt;Thank you for the explanation, but ... I am comparing two fields, so I cannot add the regex ^ and $ parameters to the match command, or can I?&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2019 08:05:20 GMT</pubDate>
    <dc:creator>RobertEttinger8</dc:creator>
    <dc:date>2019-10-07T08:05:20Z</dc:date>
    <item>
      <title>Matching showing incorrect values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493409#M137631</link>
      <description>&lt;P&gt;Hi guys &amp;amp; girls,&lt;/P&gt;

&lt;P&gt;about the following query:&lt;/P&gt;

&lt;P&gt;| makeresults&lt;BR /&gt;
| eval expectedm="10"&lt;BR /&gt;
| eval expectedM="1"&lt;BR /&gt;
| eval match=case(match(expectedm, expectedM), "Yes", true(), "No")&lt;BR /&gt;
| eval match1=if(expectedm=expectedM, "Yes", "No")&lt;/P&gt;

&lt;P&gt;...Why are the results different? It's almost like the MATCH command is adding a hidden .* at the end of the string ... If so, how to fix this?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;BR /&gt;
Robert&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 11:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493409#M137631</guid>
      <dc:creator>RobertEttinger8</dc:creator>
      <dc:date>2019-10-06T11:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Matching showing incorrect values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493410#M137632</link>
      <description>&lt;P&gt;The &lt;CODE&gt;match&lt;/CODE&gt; function expects a regular expression as its second argument.  Every regex has an implicit &lt;CODE&gt;.*&lt;/CODE&gt; at each end unless an anchor is used.  That means the &lt;CODE&gt;match&lt;/CODE&gt; in your sample code will match any expectedm that contains the digit '1'.  To look for exactly "1", use &lt;CODE&gt;expectedM=^1$&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 12:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493410#M137632</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-10-06T12:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Matching showing incorrect values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493411#M137633</link>
      <description>&lt;P&gt;Thank you for the explanation, but ... I am comparing two fields, so I cannot add the regex ^ and $ parameters to the match command, or can I?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 08:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493411#M137633</guid>
      <dc:creator>RobertEttinger8</dc:creator>
      <dc:date>2019-10-07T08:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Matching showing incorrect values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493412#M137634</link>
      <description>&lt;P&gt;You can use a temporary field for the comparison.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval expectedm="10"
| eval expectedM="1"
| eval matchField="^".expectedM."$"
| eval match=case(match(expectedm, matchField), "Yes", true(), "No")
| eval match1=if(expectedm=expectedM, "Yes", "No")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Oct 2019 10:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-showing-incorrect-values/m-p/493412#M137634</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-10-07T10:43:58Z</dc:date>
    </item>
  </channel>
</rss>

