<?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 Index only one column from csv input in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Index-only-one-column-from-csv-input/m-p/371999#M93773</link>
    <description>&lt;P&gt;I wanted to index only "Date" column from this CSV file. I don't want any of the other columns to be indexed and want to skip the first row before indexing. This is a continuous monitoring file. Is there any possible way to extract a single column from CSV input file?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 20:06:36 GMT</pubDate>
    <dc:creator>vinaykata</dc:creator>
    <dc:date>2017-11-15T20:06:36Z</dc:date>
    <item>
      <title>Index only one column from csv input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-only-one-column-from-csv-input/m-p/371999#M93773</link>
      <description>&lt;P&gt;I wanted to index only "Date" column from this CSV file. I don't want any of the other columns to be indexed and want to skip the first row before indexing. This is a continuous monitoring file. Is there any possible way to extract a single column from CSV input file?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 20:06:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-only-one-column-from-csv-input/m-p/371999#M93773</guid>
      <dc:creator>vinaykata</dc:creator>
      <dc:date>2017-11-15T20:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Index only one column from csv input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-only-one-column-from-csv-input/m-p/372000#M93774</link>
      <description>&lt;P&gt;I think you could add some parsing config on your indexer to handle this.  First, you could call transforms to remove the header row (assuming that's the first row you don't want) and then SEDCMD to replace the first comma and the rest of the event with nothing.&lt;/P&gt;

&lt;P&gt;Something like this maybe (tried match both of the non-data rows in sample for discard).  This not tested so may but hopefully not too many typos..&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
TIMESTAMP_FORMAT = %m/%d/%Y
SHOULD_LINEMERGE = false
TRANSFORMS-drop_header = drop_header
SEDCMD-keep_first_row = s/^([^,]+).+/\1/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[drop_header]
REGEX = ^(Date|Report)
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Nov 2017 22:07:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-only-one-column-from-csv-input/m-p/372000#M93774</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2017-11-15T22:07:03Z</dc:date>
    </item>
  </channel>
</rss>

