<?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: Event pattern for sourcetype in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225488#M98936</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;[sourcetypeName]
TIME_PREFIX=\w+\sREPORT====
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
LINE_BREAKER=(=)\w+\s\w+====
EXTRACT-loglevel=^(?&amp;lt;loglevel&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This method assumes "TYPE" in your example was the loglevel.  &lt;/P&gt;

&lt;P&gt;Works fine with sample data I created based on your examples:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;=ERROR REPORT==== 23-May-2016::16:19:05 ===
HTTP access requested:XXXXXX
=WARN REPORT==== 23-May-2016::16:12:05 ===
HTTP access requested:XXXXXX
HTTP access requested:XXXXXX
HTTP access requested:XXXXXX
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it uses a LINE_BREAKER instead of SHOULD_LINEMERGE=True which means it doesnt need the LINEMERGER part of the pipeline and thus it speeds up data ingestion / reduces resource usage.&lt;/P&gt;

&lt;P&gt;This also removes the beggining "=" sign on each event, but hey... that's what we call license optimization where I come from. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/153239-capture.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:34:31 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2020-09-29T10:34:31Z</dc:date>
    <item>
      <title>Event pattern for sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225486#M98934</link>
      <description>&lt;P&gt;I'm troubleshooting some issues with one sourcetype and realized that Splunk is not indexing events very well. The format for these events is a little different, but there are clear boundaries and these are always prefixed by =LOGLEVEL REPORT====Date====, and end with two lines feeds. it would be nice if splunk could split events on these boundaries.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Break events based on these boundaries&lt;/LI&gt;
&lt;LI&gt;Define a logLevel field based on the text before "REPORT"&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Example events:&lt;BR /&gt;
=TYPE REPORT==== 23-May-2016::16:19:05 ===&lt;BR /&gt;
HTTP access requested:XXXXXX&lt;/P&gt;

&lt;P&gt;How to configure the props.conf?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 16:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225486#M98934</guid>
      <dc:creator>krishnani</dc:creator>
      <dc:date>2016-08-10T16:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Event pattern for sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225487#M98935</link>
      <description>&lt;P&gt;Well, new events do not &lt;EM&gt;always&lt;/EM&gt; begin with "=LOGLEVEL REPORT====" as your example shows. (Unless "TYPE" is a log level, or maybe an abstract example.) But I would do this in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
TIME_PREFIX = \=\w+ REPORT====
MAX_TIMESTAMP_LOOKAHEAD=35
TIME_FORMAT=%d-%b-%Y::%H:%M:%S
EXTRACT-e1 = \=(&amp;lt;?loglevel&amp;gt;\w+) REPORT====
MAX_EVENTS = 500
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should actually be enough to get the events broken out correctly and with the right timestamp on each event. While it would be more efficient to create a LINEBREAKER to precisely identify the event boundary, I don't recommend that if you are new to Splunk or inexperienced with regular expressions. &lt;BR /&gt;
By default, Spunk considers the line containing the timestamp to be the first line of the event. That default should work fine in your case.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE_DATE = true   #is the default
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that I also included a setting for MAX_EVENTS. This controls the maximum number of lines per event (it isn't well named). The default is 128 lines per event - if Splunk is not separating events properly, this also could be the cause. I set the limit to 500 arbitrarily, but you should make sure that it is set to something reasonable for your data.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 16:39:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225487#M98935</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-08-10T16:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Event pattern for sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225488#M98936</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;[sourcetypeName]
TIME_PREFIX=\w+\sREPORT====
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
LINE_BREAKER=(=)\w+\s\w+====
EXTRACT-loglevel=^(?&amp;lt;loglevel&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This method assumes "TYPE" in your example was the loglevel.  &lt;/P&gt;

&lt;P&gt;Works fine with sample data I created based on your examples:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;=ERROR REPORT==== 23-May-2016::16:19:05 ===
HTTP access requested:XXXXXX
=WARN REPORT==== 23-May-2016::16:12:05 ===
HTTP access requested:XXXXXX
HTTP access requested:XXXXXX
HTTP access requested:XXXXXX
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it uses a LINE_BREAKER instead of SHOULD_LINEMERGE=True which means it doesnt need the LINEMERGER part of the pipeline and thus it speeds up data ingestion / reduces resource usage.&lt;/P&gt;

&lt;P&gt;This also removes the beggining "=" sign on each event, but hey... that's what we call license optimization where I come from. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/153239-capture.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225488#M98936</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T10:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Event pattern for sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225489#M98937</link>
      <description>&lt;P&gt;Thanks guys &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 20:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Event-pattern-for-sourcetype/m-p/225489#M98937</guid>
      <dc:creator>krishnani</dc:creator>
      <dc:date>2016-08-10T20:01:19Z</dc:date>
    </item>
  </channel>
</rss>

