<?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 How to compare values in 2 fields and column that show Success/Failure? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407394#M72234</link>
    <description>&lt;P&gt;I have 2 fields as below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1    Field2
abc          abc
def          jkl
ghi          wxy
jkl
pqr
wxy
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have to compare values in Field1 with all values in Field2 and return "Success" if both are same and "Fail" if both are not same.&lt;/P&gt;

&lt;P&gt;Expected Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1    Field2     Result
abc          abc         Success
def          jkl            Fail
ghi          wxy          Fail
jkl                             Success
pqr                          Fail
wxy                          Success
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Index is same with different sourcetypes&lt;/P&gt;</description>
    <pubDate>Sun, 14 Apr 2019 10:37:11 GMT</pubDate>
    <dc:creator>shreyasathavale</dc:creator>
    <dc:date>2019-04-14T10:37:11Z</dc:date>
    <item>
      <title>How to compare values in 2 fields and column that show Success/Failure?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407394#M72234</link>
      <description>&lt;P&gt;I have 2 fields as below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1    Field2
abc          abc
def          jkl
ghi          wxy
jkl
pqr
wxy
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have to compare values in Field1 with all values in Field2 and return "Success" if both are same and "Fail" if both are not same.&lt;/P&gt;

&lt;P&gt;Expected Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1    Field2     Result
abc          abc         Success
def          jkl            Fail
ghi          wxy          Fail
jkl                             Success
pqr                          Fail
wxy                          Success
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Index is same with different sourcetypes&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2019 10:37:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407394#M72234</guid>
      <dc:creator>shreyasathavale</dc:creator>
      <dc:date>2019-04-14T10:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare values in 2 fields and column that show Success/Failure?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407395#M72235</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(your search)|table Field1,Field2|eval Result="Fail"
| join type=left Field1 [search (your search) Field2=*|table Field2
       |rename Field2 as Field1|eval Result="Success"]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Apr 2019 12:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407395#M72235</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-04-14T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare values in 2 fields and column that show Success/Failure?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407396#M72236</link>
      <description>&lt;P&gt;This assumes you passed a transformational command like &lt;CODE&gt;stats&lt;/CODE&gt; to get that table view of your metrics. If so, just append this on and make sure to replace &lt;CODE&gt;Field1&lt;/CODE&gt; and &lt;CODE&gt;Field2&lt;/CODE&gt; with your column names &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Result=if(Field1==Field2,"Success","Fail")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Apr 2019 17:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407396#M72236</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-04-14T17:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare values in 2 fields and column that show Success/Failure?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407397#M72237</link>
      <description>&lt;P&gt;Thanks @HiroshiSatoh , I tried this and it is working as expected!!!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 06:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-values-in-2-fields-and-column-that-show-Success/m-p/407397#M72237</guid>
      <dc:creator>shreyasathavale</dc:creator>
      <dc:date>2019-04-15T06:28:14Z</dc:date>
    </item>
  </channel>
</rss>

