<?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 index file with multiline events and intermittently occurring timestamps? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646571#M109967</link>
    <description>&lt;P&gt;Cheers &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;&lt;P&gt;I cannot use HF, I can only use the UF.&lt;/P&gt;&lt;P&gt;Since there are no other answers, I figure that manually preprocessing is the only way to go in this case.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2023 06:58:36 GMT</pubDate>
    <dc:creator>zapping575</dc:creator>
    <dc:date>2023-06-12T06:58:36Z</dc:date>
    <item>
      <title>How to index file with multiline events and intermittently occurring timestamps?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646004#M109899</link>
      <description>&lt;P&gt;I have a particularly challenging log format and would appreciate any inputs on how to tackle this problem.&lt;/P&gt;
&lt;H3&gt;Problem&lt;/H3&gt;
&lt;P&gt;Looking for a feasible props.conf setup that will correctly index the log below&lt;/P&gt;
&lt;P&gt;Example (blank lines only added for readability):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SINGLE_LINE_LOG_EVENT
SINGLE_LINE_LOG_EVENT
OTHER_SINGLE_LINE_LOG_EVENT

Tue 06 Jun 10:00:00 UTC 2023
ANOTHER_SINGLE_LINE_LOG_EVENT

Tue 06 Jun 10:00:01 UTC 2023
LARGE_MULTILINE_EVENT&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first three lines are all single events and should be parsed accordingly. But they have no timestamp&lt;/P&gt;
&lt;P&gt;The fourth and fifth line together form a single event&lt;/P&gt;
&lt;P&gt;Lines 6 and 7 also form a single event, but the event from line 7 is a multiline event that shall be parsed as a single event&lt;/P&gt;
&lt;P&gt;I am prepared to make the sacrifice that the lines without timestamp get assigned the CURRENT timestamp, if there is no other solution for this.&lt;/P&gt;
&lt;H3&gt;What I have already tried&lt;/H3&gt;
&lt;P&gt;I tried using the following (the Regex looks for the timestamp)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MUST_NOT_BREAK_AFTER = .{3}\s.{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\sUTC\s\d{4}
MUST_BREAK_AFTER = .{3}\s.{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\sUTC\s\d{4}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;As well as this (I tried various combinations of this, with different capture groups. Note that the file in question only has newlines and no carriage returns, hence no '\r')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SHOULD_LINEMERGE = false
LINE_BREAKER = ([\n].{3}\s.{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\sUCT\s\d{4})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 21:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646004#M109899</guid>
      <dc:creator>zapping575</dc:creator>
      <dc:date>2023-06-06T21:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to index file with multiline events and intermittently occurring timestamps?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646263#M109933</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241220"&gt;@zapping575&lt;/a&gt;&amp;nbsp;- I think you need to write your own parser that can do that.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Basically do not monitor the file directly in Splunk.&lt;/LI&gt;&lt;LI&gt;Instead, write a simple python scripted input in Splunk. (You need to use Heavy Forwarder instead of UF)&lt;/LI&gt;&lt;LI&gt;Then parse the file as you need and with script input you can assign timestamp for each event and ingest each event separately with timestamp extracted from previous values by python code.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, as I can see you have combination of single line events and multi-line events. That can also be handle in your python code which will act as parser.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!! Kindly upvote if it does!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646263#M109933</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2023-06-08T07:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to index file with multiline events and intermittently occurring timestamps?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646571#M109967</link>
      <description>&lt;P&gt;Cheers &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;&lt;P&gt;I cannot use HF, I can only use the UF.&lt;/P&gt;&lt;P&gt;Since there are no other answers, I figure that manually preprocessing is the only way to go in this case.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 06:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646571#M109967</guid>
      <dc:creator>zapping575</dc:creator>
      <dc:date>2023-06-12T06:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to index file with multiline events and intermittently occurring timestamps?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646578#M109968</link>
      <description>Is it a one program which are writing those different log entries or are there several programs to write a single log file?&lt;BR /&gt;To be honest I propose that if it's your company/partner's work ask that they will change it to write separate log files if possible.&lt;BR /&gt;r. Ismo</description>
      <pubDate>Mon, 12 Jun 2023 07:45:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646578#M109968</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-12T07:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to index file with multiline events and intermittently occurring timestamps?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646703#M109972</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;,&amp;nbsp;thanks for the reply&lt;/P&gt;&lt;P&gt;Unfortunately, I dont know how many processes are writing to said file. I can only use it "as is".&lt;/P&gt;&lt;P&gt;You are right however, this issue should be addressed on the side of the application(s) writing to that file.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 17:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-index-file-with-multiline-events-and-intermittently/m-p/646703#M109972</guid>
      <dc:creator>zapping575</dc:creator>
      <dc:date>2023-06-12T17:01:22Z</dc:date>
    </item>
  </channel>
</rss>

