<?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: Update only specific field in csv in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Update-only-specific-field-in-csv/m-p/373374#M67686</link>
    <description>&lt;P&gt;Simply put, you can't. KV Store lookups allow to only update certain records, but CSV lookups can only be written as a whole.&lt;BR /&gt;
You therefore have to do &lt;CODE&gt;| inputlookup&lt;/CODE&gt;, then do your change, and then do &lt;CODE&gt;| outputlookup&lt;/CODE&gt; so all data is written back to the lookup.&lt;/P&gt;

&lt;P&gt;You could however replace &lt;CODE&gt;| table&lt;/CODE&gt; in your example with &lt;CODE&gt;| fields&lt;/CODE&gt;. The &lt;CODE&gt;| table&lt;/CODE&gt; command is only used for graphical representation, and is considerably slower than &lt;CODE&gt;| fields&lt;/CODE&gt;, although it has the same effect in your use case.&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 09:42:31 GMT</pubDate>
    <dc:creator>xpac</dc:creator>
    <dc:date>2018-05-02T09:42:31Z</dc:date>
    <item>
      <title>Update only specific field in csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Update-only-specific-field-in-csv/m-p/373373#M67685</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am running a search query which take input from lookup and generate counts for each row. And I want to update only specific column "No_Of_MXTIMING_Events" in the csv. It should't change the row count and I don't want to rewrite full csv again.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Query to generate "No_Of_MXTIMING_Events"&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Test_Row_Count.csv | where isnull(No_TPS_Events) OR isnull(No_TPS_Events)
| eval Start_epoc=Start 
| eval Stop_epoc=Stop 
| table ID, Start_epoc , Stop_epoc, Host 
| map maxsearches=1001 search="| tstats summariesonly=true count(MXTIMING.Elapsed) as No_Of_MXTIMING_lines FROM datamodel=MXTIMING_V8 WHERE 
    host=$Host$ earliest=$Start_epoc$ latest=$Stop_epoc$  | eval ID=\"$ID$\" | eval Host=\"$Host$\" " 
| sort 0 - by ID 
| table ID, Host, No_Of_MXTIMING_lines
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/251600-saved-test.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Update-only-specific-field-in-csv/m-p/373373#M67685</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2020-09-29T19:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update only specific field in csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Update-only-specific-field-in-csv/m-p/373374#M67686</link>
      <description>&lt;P&gt;Simply put, you can't. KV Store lookups allow to only update certain records, but CSV lookups can only be written as a whole.&lt;BR /&gt;
You therefore have to do &lt;CODE&gt;| inputlookup&lt;/CODE&gt;, then do your change, and then do &lt;CODE&gt;| outputlookup&lt;/CODE&gt; so all data is written back to the lookup.&lt;/P&gt;

&lt;P&gt;You could however replace &lt;CODE&gt;| table&lt;/CODE&gt; in your example with &lt;CODE&gt;| fields&lt;/CODE&gt;. The &lt;CODE&gt;| table&lt;/CODE&gt; command is only used for graphical representation, and is considerably slower than &lt;CODE&gt;| fields&lt;/CODE&gt;, although it has the same effect in your use case.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 09:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Update-only-specific-field-in-csv/m-p/373374#M67686</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-02T09:42:31Z</dc:date>
    </item>
  </channel>
</rss>

