<?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 transpose CSV into separate columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325113#M96973</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="reg_sales_csv" | dedup ProductId, Region| stats latest(TimeStamp) as TimeStamp by ProductId, Region, Quantity| xyseries ProductId Region Quantity| table ProductId , TimeStamp , GA, TX | fillnull Quantity=NA | lookup ProductSales.csv ProductId OUTPUT Product_name as ProductName Price | table ProductId ProductName Price TimeStamp GA TX
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Sep 2017 20:34:41 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-09-06T20:34:41Z</dc:date>
    <item>
      <title>How to transpose CSV into separate columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325111#M96971</link>
      <description>&lt;P&gt;I have the below two csv files:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;ProductSales.csv &lt;/LI&gt;
&lt;LI&gt;RegionalSales.csv&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;ProductSales.csv&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;ProductId,Product_name,Price&lt;BR /&gt;
DB-SG-G01,Mediocre Kingdoms,24.99&lt;BR /&gt;
DC-SG-G02,Dream Crusher,39.99&lt;BR /&gt;
FS-SG-G03,Final Sequel,24.99&lt;BR /&gt;
WC-SH-G04,World of Cheese,24.99&lt;BR /&gt;
WC-SH-T0,World of Cheese Tee,9.99&lt;BR /&gt;
PZ-SG-G05,Puppies vs. Zombies,4.99&lt;BR /&gt;
CU-PG-G06,Curling 2014,19.99&lt;BR /&gt;
MB-AG-G07,Manganiello Bros.,39.99&lt;BR /&gt;
MB-AG-T0,Manganiello Bros. Tee,9.99&lt;BR /&gt;
FI-AG-G08,Orvil the Wolverine,39.99&lt;BR /&gt;
BS-AG-G09,Benign Space Debris,24.99&lt;BR /&gt;
SC-MG-G10,SIM Cubicle,19.99&lt;BR /&gt;
WC-SH-A01,Holy Blade of Gouda,5.99&lt;BR /&gt;
WC-SH-A02,Fire Resistance Suit of Provolone,3.99&lt;/P&gt;

&lt;P&gt;RegionalSales.csv&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;ProductId,TimeStamp,Region,Quantity&lt;BR /&gt;
DC-SG-G01,9/6/2017,GA,5&lt;BR /&gt;
DC-SG-G01,9/5/2017,GA,3&lt;BR /&gt;
DC-SG-G01,9/4/2017,GA,6&lt;BR /&gt;
DC-SG-G01,9/3/2017,GA,2&lt;BR /&gt;
DC-SG-G01,9/6/2017,GA,1&lt;BR /&gt;
DC-SG-G01,9/6/2017,TX,4&lt;BR /&gt;
DC-SG-G01,9/5/2017,TX,5&lt;BR /&gt;
DC-SG-G01,9/3/2017,TX,6&lt;BR /&gt;
DC-SG-G01,9/2/2017,TX,1&lt;BR /&gt;
DC-SG-G01,9/2/2017,TX,2&lt;BR /&gt;
DC-SG-G02,9/3/2017,GA,4&lt;BR /&gt;
DC-SG-G02,9/4/2017,GA,3&lt;BR /&gt;
DC-SG-G02,9/3/2017,GA,5&lt;BR /&gt;
DC-SG-G02,9/3/2017,GA,7&lt;BR /&gt;
DC-SG-G02,9/1/2017,GA,9&lt;BR /&gt;
DC-SG-G02,9/3/2017,TX,2&lt;BR /&gt;
DC-SG-G02,9/4/2017,TX,5&lt;BR /&gt;
DC-SG-G02,9/3/2017,TX,7&lt;BR /&gt;
DC-SG-G02,9/3/2017,TX,2&lt;BR /&gt;
DC-SG-G02,9/1/2017,TX,1&lt;/P&gt;

&lt;P&gt;Added &lt;STRONG&gt;RegionalSales.csv&lt;/STRONG&gt; file using &lt;STRONG&gt;"Add Data" -&amp;gt; "Monitor" -&amp;gt; "Files&amp;amp;Directory"&lt;/STRONG&gt; options and Created a lookup table and configure the automatic lookup for the &lt;STRONG&gt;ProductSales.csv&lt;/STRONG&gt; file. &lt;/P&gt;

&lt;P&gt;Now doing search for the latest regional sales using below query:&lt;/P&gt;

&lt;P&gt;sourcetype="reg_sales_csv" | dedup ProductId, Region| stats latest(TimeStamp) as TimeStamp by ProductId, Region, Quantity| xyseries ProductId Region Quantity| table ProductId , TimeStamp , GA, TX | fillnull Quantity=NA&lt;/P&gt;

&lt;P&gt;So the search output something like below:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/209760-searchresult.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;But not able to take the fields from the lookup table(SalesDetails.csv).&lt;/P&gt;

&lt;P&gt;Actually expecting the below kind of table. &lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/209762-expected.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Need to display &lt;STRONG&gt;ProductName, Price&lt;/STRONG&gt; fields for each productId from the lookup table.&lt;/P&gt;

&lt;P&gt;How to join these search result with the lookup table matching records and framing this kind of table?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325111#M96971</guid>
      <dc:creator>tskarthic</dc:creator>
      <dc:date>2020-09-29T15:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose CSV into separate columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325112#M96972</link>
      <description>&lt;P&gt;Try:&lt;BR /&gt;
[your search] | table *&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 20:29:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325112#M96972</guid>
      <dc:creator>timpacl</dc:creator>
      <dc:date>2017-09-06T20:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to transpose CSV into separate columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325113#M96973</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="reg_sales_csv" | dedup ProductId, Region| stats latest(TimeStamp) as TimeStamp by ProductId, Region, Quantity| xyseries ProductId Region Quantity| table ProductId , TimeStamp , GA, TX | fillnull Quantity=NA | lookup ProductSales.csv ProductId OUTPUT Product_name as ProductName Price | table ProductId ProductName Price TimeStamp GA TX
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Sep 2017 20:34:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-transpose-CSV-into-separate-columns/m-p/325113#M96973</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-06T20:34:41Z</dc:date>
    </item>
  </channel>
</rss>

