<?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: Need to customize log4j sourcetype in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15585#M1762</link>
    <description>&lt;P&gt;Watch out, reader! In the second, very useful, snippet, the backslash has been lost and is needed in front of each 'r', 'n', and 'd':&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = ([\r\n]+)(?=\d{4}-\d{2}-\d{2} \d{1,2}:\d{2}:\d{2},\d{3})
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Dec 2015 22:56:30 GMT</pubDate>
    <dc:creator>altinp</dc:creator>
    <dc:date>2015-12-01T22:56:30Z</dc:date>
    <item>
      <title>Need to customize log4j sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15582#M1759</link>
      <description>&lt;P&gt;The logs I'm trying to index are in a log4j style, and entries such as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-06-15 09:04:08,204 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel
.Default (self-tuning)'][intOrdId=17746,intVrsn=18846] DEBUG com.att.canopi.idis
.ordermanagement.sms.cramer.adapter.util.ReflectionsTools.ipagi1a1.snt.bst.bls.c
om - Set value1:Customer100 field name1:customerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;are properly split into unique entries, however some entries are multi-line, and have embedded XML, and these are split wherever a date (with a different format than the date at the start of an entry) is found, so the log entry&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-06-15 09:04:07,686 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel
.Default (self-tuning)'][intOrdId=17746,intVrsn=18846] INFO  fooHandler - &amp;lt;env:Envelope xmlns:env="
http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;
  &amp;lt;env:Header/&amp;gt;
  &amp;lt;env:Body&amp;gt;
    &amp;lt;v1:getFooDetailRequest xmlns:v1="ns1" correlationId="coid" systemId="mybox" clientId="cid" mock="false" requestTime="2010-06-15T09:04:07.643-04:00"&amp;gt;
       &amp;lt;v1:fooId&amp;gt;foo&amp;lt;v1:fooId&amp;gt;
    &amp;lt;/v1:getFooDetailRequest&amp;gt;
  &amp;lt;/env:Body&amp;gt;
&amp;lt;/env:Envelope&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gets split on the "getFooDetailRequest" line into two entries.&lt;/P&gt;

&lt;P&gt;I've tried writing my own sourcetype in a props.conf with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MORE_THAN_100 = ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} \[.*?
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and setting the files to that sourcetype manually, but I get the same result.&lt;/P&gt;

&lt;P&gt;Does anyone know how to modify the built-in log4j sourcetype (since it is so close to being perfect), or have any other suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2010 02:05:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15582#M1759</guid>
      <dc:creator>Adam</dc:creator>
      <dc:date>2010-06-16T02:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to customize log4j sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15583#M1760</link>
      <description>&lt;P&gt;You can override any Splunk default configurations by setting the corresponding setting name (under the same stanza header, in this case &lt;CODE&gt;[log4j]&lt;/CODE&gt;), in the "local" directory. Basically, a setting in a "local" dir version of a file overrides the corresponding setting in the corresponding stanza in the "default" dir. Although the fact is, it's probably better to just define it over:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4j]
BREAK_ONLY_BEFORE =
BREAK_ONLY_BEFORE_DATE = true
SHOULD_LINEMERGE = true
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
TIME_PREFIX = ^
MAX_TIMESTAMP_LOOKAHEAD = 25
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is probably the easiest to understand, though for high-volume systems (&amp;gt; 100 GB/day), use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4j]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)(?=\d{4}-\d{2}-\d{2} \d{1,2}:\d{2}:\d{2},\d{3})
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
TIME_PREFIX = ^
MAX_TIMESTAMP_LOOKAHEAD = 25
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Jun 2010 02:26:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15583#M1760</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-06-16T02:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need to customize log4j sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15584#M1761</link>
      <description>&lt;P&gt;That worked!  I was a little concerned because I saw a few items that still weren't split properly, but after a couple of minutes all the kinks worked out and now even XML with 10 timestamps isn't split.  Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2010 03:05:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15584#M1761</guid>
      <dc:creator>Adam</dc:creator>
      <dc:date>2010-06-16T03:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to customize log4j sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15585#M1762</link>
      <description>&lt;P&gt;Watch out, reader! In the second, very useful, snippet, the backslash has been lost and is needed in front of each 'r', 'n', and 'd':&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = ([\r\n]+)(?=\d{4}-\d{2}-\d{2} \d{1,2}:\d{2}:\d{2},\d{3})
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Dec 2015 22:56:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-to-customize-log4j-sourcetype/m-p/15585#M1762</guid>
      <dc:creator>altinp</dc:creator>
      <dc:date>2015-12-01T22:56:30Z</dc:date>
    </item>
  </channel>
</rss>

