<?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 read and write data to CSV lookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441263#M125366</link>
    <description>&lt;P&gt;I did it...  &lt;CODE&gt;[main search] | lookup file.csv fieldname OUTPUT otherfieldnames|...&lt;/CODE&gt; ... not worked&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2019 09:50:34 GMT</pubDate>
    <dc:creator>sbimizry</dc:creator>
    <dc:date>2019-08-09T09:50:34Z</dc:date>
    <item>
      <title>How to read and write data to CSV lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441261#M125364</link>
      <description>&lt;P&gt;Hi, I must write and read data from lookup files.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
 cn,srcip,destip,owner&lt;BR /&gt;
"Canada","207.188.75.136","192.1.104.10","user1"&lt;BR /&gt;
"USA","62.249.72.118","192.168.1.11","user2"&lt;/P&gt;

&lt;P&gt;and I tried to read data using  &lt;CODE&gt;| lookup file cn AS cn | table cn&lt;/CODE&gt;`&lt;CODE&gt;but it did not work.&lt;BR /&gt;
and this too&lt;/CODE&gt;| lookup file cn OUTPUT cn`.&lt;/P&gt;

&lt;P&gt;What should I do?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 08:08:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441261#M125364</guid>
      <dc:creator>sbimizry</dc:creator>
      <dc:date>2019-08-09T08:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to read and write data to CSV lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441262#M125365</link>
      <description>&lt;P&gt;If all you want to do is read the contents of the lookup try the inputlookup command.&lt;/P&gt;

&lt;P&gt;For example,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup file.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will list the entire contents of the lookup.  You can search for a specific entry in the lookup using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup file.csv | search fieldname=whatever
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To perform a lookup against the csv during a search would use the lookup command, like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[main search] | lookup file.csv fieldname OUTPUT otherfieldnames|...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To write to a lookup you would use outputlookup.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup file.csv|eval cn=if(cn=="something","something else",cn)|outputlookup file.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Will perform the lookup, and will change an entry in the field cn if it contains a specific value, and will then overwrite the original lookup (it is always advisable to test the results before performing this overwrite as errors can be embarrassing to fix).&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Sheamus&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 09:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441262#M125365</guid>
      <dc:creator>sheamus69</dc:creator>
      <dc:date>2019-08-09T09:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to read and write data to CSV lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441263#M125366</link>
      <description>&lt;P&gt;I did it...  &lt;CODE&gt;[main search] | lookup file.csv fieldname OUTPUT otherfieldnames|...&lt;/CODE&gt; ... not worked&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 09:50:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441263#M125366</guid>
      <dc:creator>sbimizry</dc:creator>
      <dc:date>2019-08-09T09:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to read and write data to CSV lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441264#M125367</link>
      <description>&lt;P&gt;What specifically are you trying to do with the lookup?  Can you give an example?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 11:00:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-read-and-write-data-to-CSV-lookup/m-p/441264#M125367</guid>
      <dc:creator>sheamus69</dc:creator>
      <dc:date>2019-08-09T11:00:15Z</dc:date>
    </item>
  </channel>
</rss>

