<?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: Mixed test/JSON log events are splitting on a date in the JSON data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413686#M73185</link>
    <description>&lt;P&gt;It really isn't much for the log file type:&lt;/P&gt;

&lt;P&gt;[storm]&lt;BR /&gt;
EXTRACT-Storm_Class_MessageType = ^[^ \n]* (?P[^ ]+)\s+[(?P\w+)&lt;BR /&gt;
TRUNCATE = 0&lt;/P&gt;

&lt;P&gt;The extraction is to pull some data out of the text part of the message, which is working fine.  &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:09:21 GMT</pubDate>
    <dc:creator>tlabue</dc:creator>
    <dc:date>2020-09-29T22:09:21Z</dc:date>
    <item>
      <title>Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413684#M73183</link>
      <description>&lt;P&gt;I have logs coming in that are either straight text (single line) or text with a JSON string as well.&lt;BR /&gt;&lt;BR /&gt;
I have no issues with the straight text, but if there is additional JSON, the event breaks on an attribute with a date.&lt;BR /&gt;&lt;BR /&gt;
If the JSON has no additional date, it appears to be OK.  &lt;/P&gt;

&lt;P&gt;Sample log event with JSON&lt;BR /&gt;
2018-11-28T11:25:32.876+0000 STDIO [INFO] 2018-11-28 11:25:32 [Thread-3-ESWriterBolt] DEBUG BaseBolt - {&lt;BR /&gt;
    "attribute1":  243,&lt;BR /&gt;
    "attribute2":  "Standard",&lt;BR /&gt;
    "attribute3": 2018-11-28T13:11:45.3720",&lt;BR /&gt;
    "attribute4": "Y"&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Everything up to attribute2 reads fine, however, attribute3 starts a new event, timestamped with the date value there, and going until the end, or until potentially another date field.  &lt;/P&gt;

&lt;P&gt;The current props.conf for this log type just parses a few fields and also includes TRUNCATE = 0 for no truncation of these events.  &lt;/P&gt;

&lt;P&gt;What additional to I need to setup in props.conf to make this work?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 20:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413684#M73183</guid>
      <dc:creator>tlabue</dc:creator>
      <dc:date>2018-11-28T20:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413685#M73184</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please post your props.conf for above data?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 15:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413685#M73184</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-11-29T15:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413686#M73185</link>
      <description>&lt;P&gt;It really isn't much for the log file type:&lt;/P&gt;

&lt;P&gt;[storm]&lt;BR /&gt;
EXTRACT-Storm_Class_MessageType = ^[^ \n]* (?P[^ ]+)\s+[(?P\w+)&lt;BR /&gt;
TRUNCATE = 0&lt;/P&gt;

&lt;P&gt;The extraction is to pull some data out of the text part of the message, which is working fine.  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:09:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413686#M73185</guid>
      <dc:creator>tlabue</dc:creator>
      <dc:date>2020-09-29T22:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413687#M73186</link>
      <description>&lt;P&gt;You can try with below configuration on Indexer OR Heavy Forwarder whichever comes first from Universal Forwarder.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N%z
MAX_TIMESTAMP_LOOKAHEAD=28
LINE_BREAKER=([\r\n]+)\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}\W\d{4}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Nov 2018 09:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413687#M73186</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-11-30T09:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413688#M73187</link>
      <description>&lt;P&gt;SHOULD_LINEMERGE &lt;STRONG&gt;must&lt;/STRONG&gt; be set to false when you use LINE_BREAKER.&lt;/P&gt;

&lt;P&gt;Other than that, this should do the trick. The reason for this behavior: by default Splunk automatically detects timestamps and also assumes that is where it should break up events. Which works fine with single line events, or events that have 1 timestamp, on their first line. But for this type of events you see it doesn't behave as you want it to.&lt;/P&gt;

&lt;P&gt;In general it is always better to define a specific LINE_BREAKER and set SHOULD_LINEMERGE to false and define explicit timestamp configuration as well (TIME_PREFIX, TIME_FORMAT, MAX_TIMESTAMP_LOOKAHEAD). This not only improves reliability of parsing, it also greatly improves the performance, as splunk doesn't have to apply all of its auto detection magic.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413688#M73187</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-09-29T22:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413689#M73188</link>
      <description>&lt;P&gt;Thanks @FrankVI, updated original answer, didn't notice this because I was playing with only one event.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 10:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413689#M73188</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-11-30T10:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Mixed test/JSON log events are splitting on a date in the JSON data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413690#M73189</link>
      <description>&lt;P&gt;Thanks for both your help.  I had tried a LINE_BREAKER previous, but it looks like my REGEX wasn't quite correct.  First indications in the development lab is that this is working.  &lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 15:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mixed-test-JSON-log-events-are-splitting-on-a-date-in-the-JSON/m-p/413690#M73189</guid>
      <dc:creator>tlabue</dc:creator>
      <dc:date>2018-11-30T15:47:03Z</dc:date>
    </item>
  </channel>
</rss>

