<?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 use sourcetype with inputcsv? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447971#M77908</link>
    <description>&lt;P&gt;So you want to fixup the data using VBA and then read it with Splunk using &lt;CODE&gt;inputcsv&lt;/CODE&gt; ? &lt;/P&gt;

&lt;P&gt;The problem I see with &lt;CODE&gt;inputcsv&lt;/CODE&gt; is that you won't be able to apply logic using props.conf as this only applies to sourcetypes for data that has been indexed. So if you want to apply something to your data before searching that data should be indexed.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 09:36:59 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-06-26T09:36:59Z</dc:date>
    <item>
      <title>How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447966#M77903</link>
      <description>&lt;P&gt;I want to apply "sourcetype" when reading csv file by "inputcsv" command.&lt;/P&gt;

&lt;P&gt;Is this possible by setting "props.conf"?&lt;/P&gt;

&lt;P&gt;I want to set the header arbitrarily as below and before.&lt;/P&gt;

&lt;P&gt;Before&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AAA,AAA,AAA
System1,User1,NW1
System2,User2,NW2
System3,User3,NW3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sys,Usr,NW
System1,User1,NW1
System2,User2,NW2
System3,User3,NW3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is because duplicate field names are fixed in a system that outputs CSV.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 02:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447966#M77903</guid>
      <dc:creator>ketaka</dc:creator>
      <dc:date>2019-06-25T02:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447967#M77904</link>
      <description>&lt;P&gt;You might want to try the accepted answer in this post: &lt;A href="https://answers.splunk.com/answers/432261/is-there-a-way-to-rename-csv-column-headers-prior.html"&gt;https://answers.splunk.com/answers/432261/is-there-a-way-to-rename-csv-column-headers-prior.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 03:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447967#M77904</guid>
      <dc:creator>denzelchung</dc:creator>
      <dc:date>2019-06-25T03:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447968#M77905</link>
      <description>&lt;P&gt;Thank you for your quick reply&lt;/P&gt;

&lt;P&gt;I saw the posted post.&lt;BR /&gt;
However, it does not work as expected.&lt;/P&gt;

&lt;P&gt;It seems that my study is not enough to understand.&lt;BR /&gt;
The relationship between the inputcsv command and props.conf and transforms.conf can not be understood.&lt;BR /&gt;
I will continue to investigate.&lt;/P&gt;

&lt;P&gt;The set contents and commands are described below.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;input csv file path&lt;BR /&gt;
/Splunk/var/run/splunk/csv/inputtest.csv&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;use spl&lt;BR /&gt;
|inputcsv inputtest.csv&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;conf file settings&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;transforms.conf
/Splunk/etc/system/local/transforms.conf&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;~~~&lt;BR /&gt;
[inputtest]&lt;BR /&gt;
DELIMS = ","&lt;BR /&gt;
FIELDS = "Sys","Usr","NW"&lt;BR /&gt;
~~~&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;props.conf 
/Splunk/etc/system/local/props.conf&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;~~~&lt;BR /&gt;
[inputtest]&lt;BR /&gt;
KV_MODE = none&lt;BR /&gt;
filename = inputtest.csv&lt;BR /&gt;
REPORT-testHeader = inputtest&lt;BR /&gt;
~~~&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 05:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447968#M77905</guid>
      <dc:creator>ketaka</dc:creator>
      <dc:date>2019-06-25T05:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447969#M77906</link>
      <description>&lt;P&gt;Hi @ketaka,&lt;/P&gt;

&lt;P&gt;If you wish to apply a &lt;CODE&gt;sourcetype&lt;/CODE&gt; to a CSV file you need to index it. Using &lt;CODE&gt;inputcsv&lt;/CODE&gt;only reads the csv file just as an &lt;CODE&gt;inputlookup&lt;/CODE&gt; would. If you don't want to index your data then you can rename the fields using the &lt;CODE&gt;rename&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;If your only solution is to apply a &lt;CODE&gt;sourcetype&lt;/CODE&gt; you will have to index your csv file. Below some docs with options and params for indexing csv and other structured files.&lt;/P&gt;

&lt;P&gt;This is a great read for indexing csv files of all kinds :&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Extractfieldsfromfileswithstructureddata"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Extractfieldsfromfileswithstructureddata&lt;/A&gt;&lt;BR /&gt;
All available configurations for structured data in props can be found here :&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#Structured_Data_Header_Extraction_and_configuration"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#Structured_Data_Header_Extraction_and_configuration&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 09:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447969#M77906</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-25T09:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447970#M77907</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;

&lt;P&gt;Thank you for your comment.&lt;/P&gt;

&lt;P&gt;Unfortunately I don't want to make an index.&lt;BR /&gt;
I want to load a CSV file each time and perform new tabulation.&lt;BR /&gt;
and I want to distinguish duplicate header names as aliases.&lt;/P&gt;

&lt;P&gt;I think this is a departure from the benefits of Splunk.&lt;BR /&gt;
However, there is an instruction to move from Excel VBA to Splunkn, and I am looking for a way.&lt;/P&gt;

&lt;P&gt;I thought that I could cope by loading csv file with SPL's inputcsv command each time.&lt;/P&gt;

&lt;P&gt;I'm continuously examining the inputcsv command, inputs.conf, and props.conf.&lt;/P&gt;

&lt;P&gt;Please be aware that terms and recognition may not be correct.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;ketaka&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 06:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447970#M77907</guid>
      <dc:creator>ketaka</dc:creator>
      <dc:date>2019-06-26T06:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447971#M77908</link>
      <description>&lt;P&gt;So you want to fixup the data using VBA and then read it with Splunk using &lt;CODE&gt;inputcsv&lt;/CODE&gt; ? &lt;/P&gt;

&lt;P&gt;The problem I see with &lt;CODE&gt;inputcsv&lt;/CODE&gt; is that you won't be able to apply logic using props.conf as this only applies to sourcetypes for data that has been indexed. So if you want to apply something to your data before searching that data should be indexed.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 09:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447971#M77908</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-26T09:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to use sourcetype with inputcsv?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447972#M77909</link>
      <description>&lt;P&gt;CSV files are output in a fixed form from other departments' systems.&lt;BR /&gt;
I'm trying to replace the file processing Excel with Splunk.&lt;/P&gt;

&lt;P&gt;I see, props.conf works only for indexed data..&lt;/P&gt;

&lt;P&gt;It turns out that we need to think about different means.&lt;/P&gt;

&lt;P&gt;Thank you for your reply many times.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;(The following may be unnecessary content, sorry.&lt;/P&gt;

&lt;P&gt;The summary of what you want to do is to load three types of standard CSV files, and output one CSV file after processing.&lt;BR /&gt;
At that time, it is necessary to delete previous data and perform new processing.&lt;BR /&gt;
I think this process is not suitable for Splunk, which indexes and accumulates data.&lt;BR /&gt;
&amp;nbsp;If you look only at my work on the project, it may not be worthwhile to use Splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 14:55:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-sourcetype-with-inputcsv/m-p/447972#M77909</guid>
      <dc:creator>ketaka</dc:creator>
      <dc:date>2019-06-26T14:55:03Z</dc:date>
    </item>
  </channel>
</rss>

