<?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: csv advise in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60565#M12028</link>
    <description>&lt;OL&gt;
&lt;LI&gt;Just have Splunk monitor the directory. It won't be confused by files being removed - it has pulled the data into its own index so it doesn't rely on that files are kept.&lt;/LI&gt;
&lt;LI&gt;Splunk automatically extracts key/value pairs that are in the form key=value, however &lt;CODE&gt;host&lt;/CODE&gt; is a special field in Splunk that specifies which host log data originated from so it's likely that the host value from the log events is being overwritten with that. You could extract the field and call it something else, let's say &lt;CODE&gt;myhost&lt;/CODE&gt;: &lt;CODE&gt;... | rex "host=(?&amp;lt;myhost&amp;gt;.+?),"&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Fri, 25 May 2012 12:53:07 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-05-25T12:53:07Z</dc:date>
    <item>
      <title>csv advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60563#M12026</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Hoping someone can help me with some csv input questions. I have some csv files that are created by users, and which are generated by a cron job (which I don't control). The files are all in the same directory, and have a suffix of .txt.  What is the best way to get this data into Splunk? I was thinking curl, but the system doesn't have it. Should I just setup a splunk agent to monitor the files in that directory? The files do get cleaned up, so what happens if they get removed? Will it confuse Splunk?&lt;/P&gt;

&lt;P&gt;My second question is how to get splunk to auto-identify the columns? Sample data is below - is there a way to tell splunk that the host is in column 2?&lt;/P&gt;

&lt;P&gt;Timestamp=24-May-12 18:41:00,host=APF-US412-RH-Cpu-0,metric=CPU_Utilization,value=2.00000000,DURATION=336&lt;BR /&gt;
Timestamp=24-May-12 18:46:36,host=APF-US412-RH-Cpu-0,metric=CPU_Utilization,value=2.00000000,DURATION=339&lt;BR /&gt;
Timestamp=24-May-12 18:52:15,host=APF-US412-RH-Cpu-0,metric=CPU_Utilization,value=2.00000000,DURATION=338&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:51:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60563#M12026</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-28T11:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: csv advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60564#M12027</link>
      <description>&lt;P&gt;1) monitor the files, splunk is very good about not loading the same file twice, or for that matter, knowing where it left of on a file.&lt;/P&gt;

&lt;P&gt;2) look at transforms.conf for:&lt;/P&gt;

&lt;P&gt;[extract_csv]&lt;/P&gt;

&lt;P&gt;DELIMS = ","&lt;/P&gt;

&lt;P&gt;FIELDS = "field1", "field2", "field3"&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2012 12:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60564#M12027</guid>
      <dc:creator>fk319</dc:creator>
      <dc:date>2012-05-25T12:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: csv advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60565#M12028</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Just have Splunk monitor the directory. It won't be confused by files being removed - it has pulled the data into its own index so it doesn't rely on that files are kept.&lt;/LI&gt;
&lt;LI&gt;Splunk automatically extracts key/value pairs that are in the form key=value, however &lt;CODE&gt;host&lt;/CODE&gt; is a special field in Splunk that specifies which host log data originated from so it's likely that the host value from the log events is being overwritten with that. You could extract the field and call it something else, let's say &lt;CODE&gt;myhost&lt;/CODE&gt;: &lt;CODE&gt;... | rex "host=(?&amp;lt;myhost&amp;gt;.+?),"&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 25 May 2012 12:53:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60565#M12028</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-25T12:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: csv advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60566#M12029</link>
      <description>&lt;P&gt;Thanks. I  see data coming in, but a couple of things aren't right:&lt;/P&gt;

&lt;P&gt;1) it's not picking up the timestamp in the file as the timestamp to use.&lt;BR /&gt;
2) It's not generating unique events for each line. Bunches of them are indexed as one event. (Maybe related to # 1?)&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2012 15:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60566#M12029</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2012-05-25T15:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: csv advise</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60567#M12030</link>
      <description>&lt;P&gt;Yes, #2 is definitely related to #1. By default, Splunk breaks incoming data into new events whenever it sees a valid timestamp, so if it doesn't find one it won't break. This section in the docs covers configuring timestamp recognition well: &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.2/Data/Configuretimestamprecognition"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.2/Data/Configuretimestamprecognition&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2012 19:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/csv-advise/m-p/60567#M12030</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-25T19:25:19Z</dc:date>
    </item>
  </channel>
</rss>

