<?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 update particular row of existing lookup csv ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464612#M130931</link>
    <description>&lt;P&gt;The basic approach is to read in the CSV file, change what needs to be changed, and then re-write the file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup my.csv
| eval Name = if(Name=="Test_4", "Test_8", Name)
| outputlookup my.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 Mar 2020 12:41:33 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-03-31T12:41:33Z</dc:date>
    <item>
      <title>How to update particular row of existing lookup csv ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464611#M130930</link>
      <description>&lt;P&gt;I have existing lookup csv. I want to update a row with new value.&lt;BR /&gt;
ID  Name    Location&lt;BR /&gt;
549 Test_1  Bangalore&lt;BR /&gt;
549 Test_2  Delhi&lt;BR /&gt;
729 Test_3  Mumbai&lt;BR /&gt;
549 Test_4  Bangalore&lt;BR /&gt;
729 Test_5  Bangalore&lt;/P&gt;

&lt;P&gt;Test_4 will be replace with Test_8 and my lookup table will be look like as below&lt;/P&gt;

&lt;P&gt;ID  Name    Location&lt;BR /&gt;
549 Test_1  Bangalore&lt;BR /&gt;
549 Test_2  Delhi&lt;BR /&gt;
729 Test_3  Mumbai&lt;BR /&gt;
549 Test_8  Bangalore&lt;BR /&gt;
729 Test_5  Bangalore&lt;/P&gt;

&lt;P&gt;How can I achieve it through search query. &lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
Raja&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464611#M130930</guid>
      <dc:creator>patra966</dc:creator>
      <dc:date>2020-09-30T04:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to update particular row of existing lookup csv ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464612#M130931</link>
      <description>&lt;P&gt;The basic approach is to read in the CSV file, change what needs to be changed, and then re-write the file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup my.csv
| eval Name = if(Name=="Test_4", "Test_8", Name)
| outputlookup my.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464612#M130931</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-31T12:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to update particular row of existing lookup csv ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464613#M130932</link>
      <description>&lt;P&gt;Let consider another scenario.&lt;/P&gt;

&lt;P&gt;If my Name column suppose to be "Test Name". &lt;/P&gt;

&lt;H2&gt;Case-1:&lt;/H2&gt;

&lt;P&gt;| inputlookup my.csv&lt;BR /&gt;
 | eval "Test Name" = if("Test Name"=="Test_4", "Test_8", "Test Name")&lt;BR /&gt;
 | outputlookup my.csv&lt;/P&gt;

&lt;P&gt;For this I am getting like below:&lt;BR /&gt;
 ID   Test Name Location&lt;BR /&gt;
549 Test Name Bangalore&lt;BR /&gt;
549 Test Name Delhi&lt;BR /&gt;
729 Test Name Mumbai&lt;BR /&gt;
549 Test Name Bangalore&lt;BR /&gt;
729 Test Name Bangalore&lt;/P&gt;

&lt;H2&gt;Case- 2:&lt;/H2&gt;

&lt;P&gt;| inputlookup my.csv&lt;BR /&gt;
 | eval Test Name = if(Test Name=="Test_4", "Test_8", Test Name)&lt;BR /&gt;
 | outputlookup my.csv&lt;BR /&gt;
Getting error for this. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-particular-row-of-existing-lookup-csv/m-p/464613#M130932</guid>
      <dc:creator>patra966</dc:creator>
      <dc:date>2020-09-30T04:51:35Z</dc:date>
    </item>
  </channel>
</rss>

