<?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: How to compare two CSV files with multiple rows in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-two-CSV-files-with-multiple-rows/m-p/501252#M85397</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
You could use the "join " command to achieve functionality.&lt;BR /&gt;
Please try the below functionality.Please let us know whether it worked.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=source_file1 souretype=source_file1
|table Date,Status,User
|join type=inner User 
|[search index=source_file2 souretype=source_file2  
|eval Date_file2=Date,Status_file2=Status
|table Date_file2,Status_file2]
|eval match_date=if(Date_file2==Date,1,0),match_status=if(Status_file2==Status,1,0)
|where match_date=1 OR match_status=1
|table User,Date,Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Dec 2019 21:36:42 GMT</pubDate>
    <dc:creator>dindu</dc:creator>
    <dc:date>2019-12-04T21:36:42Z</dc:date>
    <item>
      <title>How to compare two CSV files with multiple rows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-two-CSV-files-with-multiple-rows/m-p/501251#M85396</link>
      <description>&lt;P&gt;I am looking to compare two CSV files to output a change or addition. &lt;BR /&gt;
Example:&lt;/P&gt;

&lt;P&gt;File 1:&lt;BR /&gt;
&lt;STRONG&gt;User        Date   Status&lt;/STRONG&gt;&lt;BR /&gt;
Dave         1/1     New&lt;BR /&gt;
Linda        1/2     Old&lt;BR /&gt;
Bob           1/3     Old&lt;/P&gt;

&lt;P&gt;File 2:&lt;BR /&gt;
&lt;STRONG&gt;User       Date     Status&lt;/STRONG&gt;&lt;BR /&gt;
Dave        1/1      Old&lt;BR /&gt;
Dave        1/2      New&lt;BR /&gt;
Linda       1/2      Old&lt;BR /&gt;
Tony        1/8      New&lt;/P&gt;

&lt;P&gt;If the user from File 1 matches File 2 and either row "date" and "status" have changed then output that information plus any new additions. Expected output&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;User    Date    Status&lt;/STRONG&gt;&lt;BR /&gt;
Dave      1/1      Old&lt;BR /&gt;
Dave     1/2       New&lt;BR /&gt;
Tony     1/8       New&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-two-CSV-files-with-multiple-rows/m-p/501251#M85396</guid>
      <dc:creator>vulnfree</dc:creator>
      <dc:date>2019-12-04T18:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two CSV files with multiple rows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-two-CSV-files-with-multiple-rows/m-p/501252#M85397</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
You could use the "join " command to achieve functionality.&lt;BR /&gt;
Please try the below functionality.Please let us know whether it worked.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=source_file1 souretype=source_file1
|table Date,Status,User
|join type=inner User 
|[search index=source_file2 souretype=source_file2  
|eval Date_file2=Date,Status_file2=Status
|table Date_file2,Status_file2]
|eval match_date=if(Date_file2==Date,1,0),match_status=if(Status_file2==Status,1,0)
|where match_date=1 OR match_status=1
|table User,Date,Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 21:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-compare-two-CSV-files-with-multiple-rows/m-p/501252#M85397</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2019-12-04T21:36:42Z</dc:date>
    </item>
  </channel>
</rss>

