<?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 lookup field from csv file using automatic lookups? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152652#M42762</link>
    <description>&lt;P&gt;Follow below steps&lt;/P&gt;

&lt;P&gt;Step 1: Add CSV file containing columns &lt;CODE&gt;Brand_ID, Brand_Name&lt;/CODE&gt; under lookups folder&lt;/P&gt;

&lt;P&gt;Step 2: Add a Stanza in your transforms.conf file like this&lt;BR /&gt;
    [csv_brand_info]&lt;BR /&gt;
    filename = brand_info.csv&lt;BR /&gt;
    max_matches = 1&lt;BR /&gt;
    case_sensitive_match = false&lt;/P&gt;

&lt;P&gt;Step 3: Write search to include lookup like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search.. | stats count as Count by brand_id | lookup  csv_brand_info Brand_ID as brand_id OUTPUT Brand_ID Brand_Name | table Brand_ID Brand_Name Count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:08:20 GMT</pubDate>
    <dc:creator>strive</dc:creator>
    <dc:date>2020-09-28T17:08:20Z</dc:date>
    <item>
      <title>How to lookup field from csv file using automatic lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152650#M42760</link>
      <description>&lt;P&gt;We have indexed csv file and it has field brand_id, can you please provide steps how to lookup this brand_id field equivalent to brand_name using automatic lookup in the output.&lt;/P&gt;

&lt;P&gt;Input data (csv) :&lt;/P&gt;

&lt;P&gt;brand_id,field1,field2,field3&lt;BR /&gt;
1,11,111,1111&lt;BR /&gt;
2,22,222,2222&lt;BR /&gt;
3,33,333,3333&lt;BR /&gt;
1,22,222,2222&lt;BR /&gt;
2,11,111,1111&lt;BR /&gt;
1,11,111,1111&lt;/P&gt;

&lt;P&gt;Required output (brandwise stats count):&lt;/P&gt;

&lt;P&gt;brand_id,brand_name,count&lt;BR /&gt;
1,xyz,3&lt;BR /&gt;
2,abc,2&lt;BR /&gt;
3,pqr,1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152650#M42760</guid>
      <dc:creator>dhavamanis</dc:creator>
      <dc:date>2020-09-28T17:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup field from csv file using automatic lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152651#M42761</link>
      <description>&lt;P&gt;Provided you have already configured a lookup table file with fields "brand_id" and "brand_name", with name say brandlookup.csv, then try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex source=yourcsvfile  | stats count by brand_id | lookup brandlookup.csv brand_id OUTPUT brand_name | table brand_id, brand_name, count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152651#M42761</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T17:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup field from csv file using automatic lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152652#M42762</link>
      <description>&lt;P&gt;Follow below steps&lt;/P&gt;

&lt;P&gt;Step 1: Add CSV file containing columns &lt;CODE&gt;Brand_ID, Brand_Name&lt;/CODE&gt; under lookups folder&lt;/P&gt;

&lt;P&gt;Step 2: Add a Stanza in your transforms.conf file like this&lt;BR /&gt;
    [csv_brand_info]&lt;BR /&gt;
    filename = brand_info.csv&lt;BR /&gt;
    max_matches = 1&lt;BR /&gt;
    case_sensitive_match = false&lt;/P&gt;

&lt;P&gt;Step 3: Write search to include lookup like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search.. | stats count as Count by brand_id | lookup  csv_brand_info Brand_ID as brand_id OUTPUT Brand_ID Brand_Name | table Brand_ID Brand_Name Count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152652#M42762</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2020-09-28T17:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup field from csv file using automatic lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152653#M42763</link>
      <description>&lt;P&gt;Thanks if we try this,&lt;/P&gt;

&lt;P&gt;index="idxmember"  | stats count by brand_id | lookup lufile_brandid_brandname.csv  BRAND_ID OUTPUT BRAND_NAME | table brand_id, BRAND_NAME, count&lt;/P&gt;

&lt;P&gt;we are not getting the BRAND_NAME in the output.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152653#M42763</guid>
      <dc:creator>dhavamanis</dc:creator>
      <dc:date>2020-09-28T17:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to lookup field from csv file using automatic lookups?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152654#M42764</link>
      <description>&lt;P&gt;The case of the field name matters. If the field name is 'brand_id' , use the same during lookup. (I see the case is different for brand_id, also ensure case for brand_name)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-lookup-field-from-csv-file-using-automatic-lookups/m-p/152654#M42764</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T17:08:26Z</dc:date>
    </item>
  </channel>
</rss>

