<?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 Select only some fields from csv to index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Select-only-some-fields-from-csv-to-index/m-p/489457#M194070</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I'm in enviroment so configured:&lt;/P&gt;

&lt;P&gt;1 uf, 1 hf, 4 indexers, 1 search head, 1 master cluster.&lt;/P&gt;

&lt;P&gt;I've to index a large CSV, read from the universal forwarder, which forwards data to the HF which pass the data to the indexer.&lt;/P&gt;

&lt;P&gt;The CSV has 150 fields and I want to index only 10 of these. So I've configured these things:&lt;/P&gt;

&lt;P&gt;on &lt;STRONG&gt;universal forwarder&lt;/STRONG&gt;: &lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;inputs.conf &lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[monitor:///myfolder/Interface*]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
index = interface_metrics&lt;BR /&gt;
sourcetype = if_csv&lt;/P&gt;

&lt;P&gt;on &lt;STRONG&gt;heavy forwarder&lt;/STRONG&gt;&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[splunktcp://9996]&lt;BR /&gt;
index=interface_metrics&lt;BR /&gt;
sourcetype = if_csv&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[if_csv]&lt;BR /&gt;
INDEXED_EXTRACTIONS = CSV&lt;BR /&gt;
HEADER_FIELD_LINE_NUMBER=1&lt;BR /&gt;
HEADER_FIELD_DELIMITER =,&lt;BR /&gt;
FIELD_DELIMITER=,&lt;BR /&gt;
HEADER_FIELD_LINE_NUMBER = 0&lt;BR /&gt;
TRANSFORMS-set=setnull, setparsing, nullhead&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[setnull]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[nullhead]&lt;BR /&gt;
REGEX = ifInDiscardsDelta&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[setparsing]&lt;BR /&gt;
REGEX = ^([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;),(?:[^,]+,\s*)([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)(?:[^,]+,\s*){5}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)(?:[^,]+,\s*){3}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;),(?:[^,]+,\s*){2}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)(?:[^,]+,\s*){7}([^,]&lt;EM&gt;)(?:(?:[^,]+,?\s&lt;/EM&gt;)|(?:[,,])){123}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = indexQueue&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;example CSV row :&lt;/STRONG&gt;&lt;BR /&gt;
0ef1fa5f-586c-48a4-a902-827aef967f47,1569309580446,300.0,100,9,0,0,0,0,6.6107712E7,5.0463189E7,151356.0,150857.0,0.176,0.135,0.0,0.0,0.0,0.0,0,0,0,0,0,0,4b16e13e-c391-4626-b364-2890fe5a009a,0,0,0,0,,,151351,149267,0,0,451,5,1139,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,039550ed-1d39-487f-9b12-276ad9472771,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3.0,3.0,,,0.056,3.4E-4,0.2,3.0,3.0,,,0.056,3.4E-4,0.2,1569309300000,300&lt;/P&gt;

&lt;P&gt;I want to keep the fields:&lt;BR /&gt;
1,2,4,5,10,11,14,15,26,149,150&lt;/P&gt;

&lt;P&gt;I don't succeed in indexing only the fields that I choose, but the whole row.&lt;/P&gt;

&lt;P&gt;What I'm wrong ?&lt;/P&gt;

&lt;P&gt;Thanks &lt;BR /&gt;
Fabrizio&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:20:03 GMT</pubDate>
    <dc:creator>fabrizioalleva</dc:creator>
    <dc:date>2020-09-30T02:20:03Z</dc:date>
    <item>
      <title>Select only some fields from csv to index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Select-only-some-fields-from-csv-to-index/m-p/489457#M194070</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I'm in enviroment so configured:&lt;/P&gt;

&lt;P&gt;1 uf, 1 hf, 4 indexers, 1 search head, 1 master cluster.&lt;/P&gt;

&lt;P&gt;I've to index a large CSV, read from the universal forwarder, which forwards data to the HF which pass the data to the indexer.&lt;/P&gt;

&lt;P&gt;The CSV has 150 fields and I want to index only 10 of these. So I've configured these things:&lt;/P&gt;

&lt;P&gt;on &lt;STRONG&gt;universal forwarder&lt;/STRONG&gt;: &lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;inputs.conf &lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[monitor:///myfolder/Interface*]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
index = interface_metrics&lt;BR /&gt;
sourcetype = if_csv&lt;/P&gt;

&lt;P&gt;on &lt;STRONG&gt;heavy forwarder&lt;/STRONG&gt;&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[splunktcp://9996]&lt;BR /&gt;
index=interface_metrics&lt;BR /&gt;
sourcetype = if_csv&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[if_csv]&lt;BR /&gt;
INDEXED_EXTRACTIONS = CSV&lt;BR /&gt;
HEADER_FIELD_LINE_NUMBER=1&lt;BR /&gt;
HEADER_FIELD_DELIMITER =,&lt;BR /&gt;
FIELD_DELIMITER=,&lt;BR /&gt;
HEADER_FIELD_LINE_NUMBER = 0&lt;BR /&gt;
TRANSFORMS-set=setnull, setparsing, nullhead&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;H1&gt;------------------&lt;/H1&gt;

&lt;P&gt;[setnull]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[nullhead]&lt;BR /&gt;
REGEX = ifInDiscardsDelta&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[setparsing]&lt;BR /&gt;
REGEX = ^([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;),(?:[^,]+,\s*)([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)(?:[^,]+,\s*){5}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)(?:[^,]+,\s*){3}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;),(?:[^,]+,\s*){2}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)(?:[^,]+,\s*){7}([^,]&lt;EM&gt;)(?:(?:[^,]+,?\s&lt;/EM&gt;)|(?:[,,])){123}([^,]&lt;EM&gt;),([^,]&lt;/EM&gt;)&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = indexQueue&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;example CSV row :&lt;/STRONG&gt;&lt;BR /&gt;
0ef1fa5f-586c-48a4-a902-827aef967f47,1569309580446,300.0,100,9,0,0,0,0,6.6107712E7,5.0463189E7,151356.0,150857.0,0.176,0.135,0.0,0.0,0.0,0.0,0,0,0,0,0,0,4b16e13e-c391-4626-b364-2890fe5a009a,0,0,0,0,,,151351,149267,0,0,451,5,1139,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,039550ed-1d39-487f-9b12-276ad9472771,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3.0,3.0,,,0.056,3.4E-4,0.2,3.0,3.0,,,0.056,3.4E-4,0.2,1569309300000,300&lt;/P&gt;

&lt;P&gt;I want to keep the fields:&lt;BR /&gt;
1,2,4,5,10,11,14,15,26,149,150&lt;/P&gt;

&lt;P&gt;I don't succeed in indexing only the fields that I choose, but the whole row.&lt;/P&gt;

&lt;P&gt;What I'm wrong ?&lt;/P&gt;

&lt;P&gt;Thanks &lt;BR /&gt;
Fabrizio&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Select-only-some-fields-from-csv-to-index/m-p/489457#M194070</guid>
      <dc:creator>fabrizioalleva</dc:creator>
      <dc:date>2020-09-30T02:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select only some fields from csv to index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Select-only-some-fields-from-csv-to-index/m-p/489458#M194071</link>
      <description>&lt;P&gt;Ok,&lt;BR /&gt;
I've solved with a SED command as &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/564940/remove-fields-at-index-time-from-a-csv-file.html"&gt;https://answers.splunk.com/answers/564940/remove-fields-at-index-time-from-a-csv-file.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But is there another way to solve it ?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 12:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Select-only-some-fields-from-csv-to-index/m-p/489458#M194071</guid>
      <dc:creator>fabrizioalleva</dc:creator>
      <dc:date>2019-09-24T12:41:50Z</dc:date>
    </item>
  </channel>
</rss>

