<?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 Remove fields at index time from a CSV file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294698#M56004</link>
    <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have a CSV file that has 21 fields, I need to remove fields 1,2 &amp;amp; 15 from the CSV file as this contains sensitive information.&lt;/P&gt;

&lt;P&gt;The list is comma separated but I can't work out how to remove these at index time. I have the option to remove or mask but the value in each field is of different length. &lt;/P&gt;

&lt;P&gt;Can anyone help with the props &amp;amp; transforms required for this please. &lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Rob &lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2017 16:12:19 GMT</pubDate>
    <dc:creator>robwheeler</dc:creator>
    <dc:date>2017-08-18T16:12:19Z</dc:date>
    <item>
      <title>Remove fields at index time from a CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294698#M56004</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have a CSV file that has 21 fields, I need to remove fields 1,2 &amp;amp; 15 from the CSV file as this contains sensitive information.&lt;/P&gt;

&lt;P&gt;The list is comma separated but I can't work out how to remove these at index time. I have the option to remove or mask but the value in each field is of different length. &lt;/P&gt;

&lt;P&gt;Can anyone help with the props &amp;amp; transforms required for this please. &lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Rob &lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 16:12:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294698#M56004</guid>
      <dc:creator>robwheeler</dc:creator>
      <dc:date>2017-08-18T16:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove fields at index time from a CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294699#M56005</link>
      <description>&lt;P&gt;Try using SEDCMD.  This is the method often used for masking, but can also omit fields.  You may need to adjust the regex to match your data.&lt;/P&gt;

&lt;P&gt;In props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mySourcetype]
SEDCMD = s/([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)/\3,\4,\5,\6,\7,\8,\9,\10,\11,\12,\13,\14,\16,\17,\18,\19,\20,\21/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Aug 2017 17:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294699#M56005</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-18T17:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Remove fields at index time from a CSV file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294700#M56006</link>
      <description>&lt;P&gt;After several regex suicide commitments, I've got this below working:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;SEDCMD-subst1 = s/(([^;]*;){NN})[^;]*;(.*)/\1SUBSTITUTION;\3/g&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You can replace the semicolon with your delimiter, NN is an N-1 field to replace, SUBSTITUTION is the replacement text. You can have an empty string there to remove the field.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Mar 2019 09:40:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Remove-fields-at-index-time-from-a-CSV-file/m-p/294700#M56006</guid>
      <dc:creator>njandieri</dc:creator>
      <dc:date>2019-03-09T09:40:03Z</dc:date>
    </item>
  </channel>
</rss>

