<?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 compare values from 2 string fields and identify matches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340338#M100943</link>
    <description>&lt;P&gt;We are attempting to compare the string values from 2 different fields, and report on the values which are found in both fields.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
Date,Field1,Field2,Foo,Bar&lt;BR /&gt;
4.3.17,123456,ffgghh,sfuff,stuff&lt;BR /&gt;
4.4.17,000000,123456,stuff,stuff&lt;/P&gt;

&lt;P&gt;Report:  value 123456 is found in field1 and field2&lt;/P&gt;

&lt;P&gt;I have been able to build a table to show the values of the fields and visually find the matches, I need to be able to do this over large periods of time, and then build alerts when there is a value in Field1 which appears in Field2.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2017 17:28:47 GMT</pubDate>
    <dc:creator>mrbeck02</dc:creator>
    <dc:date>2017-06-08T17:28:47Z</dc:date>
    <item>
      <title>compare values from 2 string fields and identify matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340338#M100943</link>
      <description>&lt;P&gt;We are attempting to compare the string values from 2 different fields, and report on the values which are found in both fields.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
Date,Field1,Field2,Foo,Bar&lt;BR /&gt;
4.3.17,123456,ffgghh,sfuff,stuff&lt;BR /&gt;
4.4.17,000000,123456,stuff,stuff&lt;/P&gt;

&lt;P&gt;Report:  value 123456 is found in field1 and field2&lt;/P&gt;

&lt;P&gt;I have been able to build a table to show the values of the fields and visually find the matches, I need to be able to do this over large periods of time, and then build alerts when there is a value in Field1 which appears in Field2.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 17:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340338#M100943</guid>
      <dc:creator>mrbeck02</dc:creator>
      <dc:date>2017-06-08T17:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: compare values from 2 string fields and identify matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340339#M100944</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; your search that returns | table Date,Field1,Field2,Foo,Bar
| eval fan=mvappend("A","B")
| mvexpand fan
| eval matchfield=if(fan="A",Field1,Field2)
| stats dc(fan) as matchcount, values(*) as * by matchfield
| where matchcount&amp;gt; 1
| table matchfield
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2017 18:22:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340339#M100944</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-08T18:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: compare values from 2 string fields and identify matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340340#M100945</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;I made a few modifications, but this is working.  Much appreciated.&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
1. table Field1,Field2,matchfield,stuff,stuff&lt;BR /&gt;
2. sort - matchcount&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 20:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340340#M100945</guid>
      <dc:creator>mrbeck02</dc:creator>
      <dc:date>2017-06-08T20:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: compare values from 2 string fields and identify matches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340341#M100946</link>
      <description>&lt;P&gt;Yep, I thought about deleting line 7 or adding wording at the end, but your wording "Report: value 123456 is found in field1 and field2" didn't seem to require feeding out the foos and bars.&lt;/P&gt;

&lt;P&gt;There is a more complicated coding strategy, if you need to know which values came from which record, where after the fan you concatenate everything into a single field, with a different name for A or B, table just the matchfield and those two fields, then stats them, then use a rex to put them back into a bunch of separate fields again.  &lt;/P&gt;

&lt;P&gt;Didn't figure you needed that one, but now that you've seen the basic method, you can get there if you want.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2017 14:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/compare-values-from-2-string-fields-and-identify-matches/m-p/340341#M100946</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-09T14:22:32Z</dc:date>
    </item>
  </channel>
</rss>

