<?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 join 2 CSV files that have unique values in single table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254011#M76051</link>
    <description>&lt;P&gt;This should work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=csv1 OR source=csv2
| eval DN2 = if(source=="csv2",DN,null())
| eval DN = if(source=="csv1",DN,null())
| stats list(DN) as DN, list(DN2) as DN2, count, list(Status) as Status, 
     list(TimeStamp) as TimeStamp, list(eid) as eid, list(user) as user by uidn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you really want "all fields"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=csv1 OR source=csv2
| eval DN2 = if(source=="csv2",DN,null())
| eval DN = if(source=="csv1",DN,null())
| stats list(*) as * by uidn
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Oct 2016 21:12:50 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2016-10-13T21:12:50Z</dc:date>
    <item>
      <title>How to join 2 CSV files that have unique values in single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254010#M76050</link>
      <description>&lt;P&gt;Fields in first.csv file:  &lt;STRONG&gt;DN&lt;/STRONG&gt;, &lt;STRONG&gt;uidn&lt;/STRONG&gt;, &lt;STRONG&gt;count&lt;/STRONG&gt;, &lt;STRONG&gt;Status&lt;/STRONG&gt;, &lt;STRONG&gt;TimeStamp&lt;/STRONG&gt;&lt;BR /&gt;
Fields in second.csv file: &lt;STRONG&gt;DN&lt;/STRONG&gt;, &lt;STRONG&gt;uidn&lt;/STRONG&gt;, &lt;STRONG&gt;AppID&lt;/STRONG&gt;, &lt;STRONG&gt;eid&lt;/STRONG&gt;, &lt;STRONG&gt;user&lt;/STRONG&gt;, &lt;STRONG&gt;eStatus&lt;/STRONG&gt;, &lt;STRONG&gt;Timestamp&lt;/STRONG&gt;&lt;BR /&gt;
DN value is different in both the tables, so I want to rename as DN2 and show it on a table.&lt;BR /&gt;
Both the CSV files have unique uidn values. I want to create a single table joining all the fields,&lt;/P&gt;

&lt;P&gt;Table:&lt;BR /&gt;
uidn,DN,DN2,count,Status,TimeStamp,eid,user&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 20:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254010#M76050</guid>
      <dc:creator>krishnacasso</dc:creator>
      <dc:date>2016-10-13T20:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to join 2 CSV files that have unique values in single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254011#M76051</link>
      <description>&lt;P&gt;This should work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=csv1 OR source=csv2
| eval DN2 = if(source=="csv2",DN,null())
| eval DN = if(source=="csv1",DN,null())
| stats list(DN) as DN, list(DN2) as DN2, count, list(Status) as Status, 
     list(TimeStamp) as TimeStamp, list(eid) as eid, list(user) as user by uidn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you really want "all fields"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=csv1 OR source=csv2
| eval DN2 = if(source=="csv2",DN,null())
| eval DN = if(source=="csv1",DN,null())
| stats list(*) as * by uidn
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2016 21:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254011#M76051</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-10-13T21:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to join 2 CSV files that have unique values in single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254012#M76052</link>
      <description>&lt;P&gt;Is the join on uidn and timestamp? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlook first.csv |join uidn timestamp [|inputlookup second.csv|rename DN as DN2]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2016 21:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-CSV-files-that-have-unique-values-in-single-table/m-p/254012#M76052</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-13T21:14:58Z</dc:date>
    </item>
  </channel>
</rss>

