<?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 prevent splunk from merging few JSON strings into single event? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338996#M62561</link>
    <description>&lt;P&gt;Thank you, will try it! &lt;/P&gt;</description>
    <pubDate>Mon, 02 Jul 2018 13:06:14 GMT</pubDate>
    <dc:creator>spellanser</dc:creator>
    <dc:date>2018-07-02T13:06:14Z</dc:date>
    <item>
      <title>How to prevent splunk from merging few JSON strings into single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338992#M62557</link>
      <description>&lt;P&gt;Example raw data: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"field1": "value1", "field2": "value2", ..., "string": "1" } 
{"field1": "value1", "field2": "value2", ... ,"string":"2"} 
{"field1": "value1", "field2": "value2", ..., "string":"3" }
{"field1": "value1", "field2": "value2", ..., "string":"4" }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk merge few of raw data string into single event, as result you got 2 events. &lt;BR /&gt;
Event 1: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"field1": "value1", "field2": "value2", ..., "string": "1" } 
{"field1": "value1", "field2": "value2", ... ,"string":"2"} 
{"field1": "value1", "field2": "value2", ..., "string":"3" }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Event 2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ [-]
    field1: value1
    field2: value2
     ...
    string: 4
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, 80% of events looks like event 1 in example. But some events caught by single row and parsed as JSON type. &lt;/P&gt;

&lt;P&gt;Using cluster of Splunk Enterprise and splunkforwarder for data delivery, version 6.5.5. &lt;/P&gt;

&lt;P&gt;I have tried to setup props.conf on splunkforwarder (app which work with JSON log files), tried to use different LINE_BREAKER: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1. (\})
2. \}
3. "(^)\{" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Current props.conf: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[json-logs]
SHOULD_LINEMERGE = false
KV_MODE = json
LINE_BREAKER = (\})
TIME_PREFIX = \"time\": \"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Have same problem not only with JSON format logs, looks like props.conf line breaking options not work at all. &lt;BR /&gt;
What I am doing wrong? &lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 17:05:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338992#M62557</guid>
      <dc:creator>spellanser</dc:creator>
      <dc:date>2017-07-31T17:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent splunk from merging few JSON strings into single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338993#M62558</link>
      <description>&lt;P&gt;props.conf settings have to be present where the event parsing occurs. The forwarder (if it is a universal forwarder) does NOT parse events. If you have a UF sending your data to your indexer(s), put your props.conf for the sourcetype on the indexer(s).&lt;/P&gt;

&lt;P&gt;While a bit dated, &lt;A href="https://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings%3F"&gt;this Wiki article&lt;/A&gt; still contains accurate information on what settings apply to which phase of the event processing pipeline.&lt;/P&gt;

&lt;P&gt;You can also try to use &lt;CODE&gt;BREAK_ONLY_BEFORE=^\{&lt;/CODE&gt; instead of LINE_BREAKER if you are certain that all your events start with a '{' at the beginning of a line.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 17:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338993#M62558</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-07-31T17:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent splunk from merging few JSON strings into single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338994#M62559</link>
      <description>&lt;P&gt;Thank you for answer. I was confused with this in wiki article, which you mentioned:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Since splunk 6, some source can be parsed for structured data (like headers, or json) and be populated at the forwarder level. see &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.2/Data/Extractfieldsfromfileheadersatindextime#Forwa"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.2/Data/Extractfieldsfromfileheadersatindextime#Forwa&lt;/A&gt;... Those setting have to be on the forwarders (and indexers if they monitor files)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Looks like it's not work at all. &lt;/P&gt;

&lt;P&gt;Also i have question, what is the right way to distribute props.conf to indexers on cluster of Splunk Enterprise? Using master and master-apps or creating new custom application? &lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 09:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338994#M62559</guid>
      <dc:creator>spellanser</dc:creator>
      <dc:date>2017-08-02T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent splunk from merging few JSON strings into single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338995#M62560</link>
      <description>&lt;P&gt;Hi spellanser,&lt;/P&gt;

&lt;P&gt;I had the same problem with that merged JSON logs.&lt;BR /&gt;
I've tried various props.conf setting that were not working until I change the TIME_PREFIX, TIME_FORMAT and MAX_TIMESTAMP_LOOKAHEAD settings.&lt;BR /&gt;
My guess is when Splunk try to parsing logs and couldn't find event timestamp so then the logs were not splitted.&lt;/P&gt;

&lt;P&gt;I can see from Splunk document:&lt;BR /&gt;
TIME_PREFIX:&lt;BR /&gt;
* If the TIME_PREFIX cannot be found in the event text, timestamp extraction&lt;BR /&gt;
  will not occur.&lt;BR /&gt;
* Defaults to empty.&lt;/P&gt;

&lt;P&gt;Here is my JSON logs look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"asctime": "2018-06-22T09:13Z+0000", "exception": "xxxx", "function_name": "xxxx"}
{"asctime": "2018-06-22T09:15Z+0000", "exc_duration": 100, "exc_memory": "70 MB"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
INDEXED_EXTRACTIONS = json
KV_MODE=none
SHOULD_LINEMERGE=true
NO_BINARY_CHECK=true
BREAK_ONLY_BEFORE=([\r\n]+)
TIME_PREFIX=asctime:\s
MAX_TIMESTAMP_LOOKAHEAD=25
TIME_FORMAT=%Y-%m-%dT%H:%M:%SZ%z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this may help in your situation.&lt;BR /&gt;
Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338995#M62560</guid>
      <dc:creator>syunwei</dc:creator>
      <dc:date>2020-09-29T20:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent splunk from merging few JSON strings into single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338996#M62561</link>
      <description>&lt;P&gt;Thank you, will try it! &lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 13:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338996#M62561</guid>
      <dc:creator>spellanser</dc:creator>
      <dc:date>2018-07-02T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent splunk from merging few JSON strings into single event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338997#M62562</link>
      <description>&lt;P&gt;Hello Spellanser: Did you have any luck?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 00:42:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-prevent-splunk-from-merging-few-JSON-strings-into-single/m-p/338997#M62562</guid>
      <dc:creator>burwell</dc:creator>
      <dc:date>2018-09-26T00:42:46Z</dc:date>
    </item>
  </channel>
</rss>

