<?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 Linebreaking and event date in text file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202887#M40109</link>
    <description>&lt;P&gt;We have a text file to log row counts for CSV files used in an ETL job.  The format of the file is like this:&lt;/P&gt;

&lt;P&gt;08/30/15 16:08:51&lt;BR /&gt;
acme_file.csv: 0&lt;BR /&gt;
coyote_file.csv: 0&lt;BR /&gt;
anvil_file.csv: 88835&lt;BR /&gt;
roadrunner_file.csv: 330333&lt;/P&gt;

&lt;P&gt;I want to break this into one line per filename from line 2 onward, into fields {filename}.csv: {rowcount}   Note that the first line in the .txt file is the datetime for &lt;EM&gt;all&lt;/EM&gt; of the events.&lt;/P&gt;

&lt;P&gt;I think the linebreaking is fairly straightforward via props.conf on my indexers, but that first line with the datetime is in a different format; I want to use that and apply it to all subsequent lines.  Little help!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:09:49 GMT</pubDate>
    <dc:creator>mcomfurf</dc:creator>
    <dc:date>2020-09-29T07:09:49Z</dc:date>
    <item>
      <title>Linebreaking and event date in text file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202887#M40109</link>
      <description>&lt;P&gt;We have a text file to log row counts for CSV files used in an ETL job.  The format of the file is like this:&lt;/P&gt;

&lt;P&gt;08/30/15 16:08:51&lt;BR /&gt;
acme_file.csv: 0&lt;BR /&gt;
coyote_file.csv: 0&lt;BR /&gt;
anvil_file.csv: 88835&lt;BR /&gt;
roadrunner_file.csv: 330333&lt;/P&gt;

&lt;P&gt;I want to break this into one line per filename from line 2 onward, into fields {filename}.csv: {rowcount}   Note that the first line in the .txt file is the datetime for &lt;EM&gt;all&lt;/EM&gt; of the events.&lt;/P&gt;

&lt;P&gt;I think the linebreaking is fairly straightforward via props.conf on my indexers, but that first line with the datetime is in a different format; I want to use that and apply it to all subsequent lines.  Little help!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202887#M40109</guid>
      <dc:creator>mcomfurf</dc:creator>
      <dc:date>2020-09-29T07:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Linebreaking and event date in text file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202888#M40110</link>
      <description>&lt;P&gt;Can you have the timestamp added to the filename?  If so, you can use &lt;CODE&gt;datetime.xml&lt;/CODE&gt; easily to do this.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 21:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202888#M40110</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-09-01T21:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Linebreaking and event date in text file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202889#M40111</link>
      <description>&lt;P&gt;Yes, the timestamp is in the filename: 08-30-2015_162551__summary.txt&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202889#M40111</guid>
      <dc:creator>mcomfurf</dc:creator>
      <dc:date>2020-09-29T07:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Linebreaking and event date in text file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202890#M40112</link>
      <description>&lt;P&gt;Based on this clarification:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Yes, the timestamp is in the filename: 08-30-2015_162551__summary.txt
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can do it like this:&lt;/P&gt;

&lt;H4&gt;$SPLUNK_HOME/etc/apps/MyApp/default/datetime.xml&lt;/H4&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;define name="datetimefromfile" extract="month, day, year, hour, minute, second"&amp;gt;
   &amp;lt;text&amp;gt;&amp;lt;![CDATA[source::.*?(\d{2})-(\d{2})-(\d{4})_(\d{2})(\d{2})(\d{2})]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;timePatterns&amp;gt;
   &amp;lt;use name="datetimefromfile"/&amp;gt;
&amp;lt;/timePatterns&amp;gt;
&amp;lt;datePatterns&amp;gt;
   &amp;lt;use name="datetimefromfile"/&amp;gt;
&amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H4&gt;$SPLUNK_HOME/etc/apps/MyApp/default/props.conf:&lt;/H4&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourcetypeHere]
DATETIME_CONFIG = /etc/apps/MyApp/default/datetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Sep 2015 01:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Linebreaking-and-event-date-in-text-file/m-p/202890#M40112</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-09-02T01:04:02Z</dc:date>
    </item>
  </channel>
</rss>

