<?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 Splunk is indexing some of my json objects together in one event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147974#M30099</link>
    <description>&lt;P&gt;I've seen related questions on this subject, but I'm a total newb to splunk so I can't figure out if the problem they're having is the same or not. To make it worse, I have no idea where to put their answers in the config tree!&lt;/P&gt;

&lt;P&gt;The semi-problem:&lt;/P&gt;

&lt;P&gt;We're dumping JSON into log files on our servers. Everything is properly escaped and 1 JSON object appears per line in the logs.&lt;BR /&gt;
However, we noticed that Splunk has less records that our other logging stack.&lt;/P&gt;

&lt;P&gt;In searching, we realized that 80% or so of our events has a &lt;CODE&gt;linecount&lt;/CODE&gt; of 1, while others have 2-10 on average and one has 2000.&lt;/P&gt;

&lt;P&gt;I'm told I should create a new &lt;CODE&gt;sourcetype&lt;/CODE&gt; for my log files with a custom &lt;CODE&gt;LINE_BREAK&lt;/CODE&gt; so that Splunk correctly parses our 1 JSON object per Event.&lt;/P&gt;

&lt;P&gt;I'd like to know the following:&lt;/P&gt;

&lt;P&gt;1) What could be causing Splunk to not be able to parse my JSON logs, when others (td-agent/logstash) are able to no problem?&lt;/P&gt;

&lt;P&gt;2) Is there a key/value format (lots of text like stacktraces) which Splunk could do better with?&lt;/P&gt;

&lt;P&gt;3) If JSON is fine, what do I need to modify so that Splunk is able to parse my logs correctly?&lt;/P&gt;

&lt;P&gt;Thank you and apologies for the potential dups!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Feb 2015 18:19:09 GMT</pubDate>
    <dc:creator>lanceblais</dc:creator>
    <dc:date>2015-02-20T18:19:09Z</dc:date>
    <item>
      <title>Splunk is indexing some of my json objects together in one event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147974#M30099</link>
      <description>&lt;P&gt;I've seen related questions on this subject, but I'm a total newb to splunk so I can't figure out if the problem they're having is the same or not. To make it worse, I have no idea where to put their answers in the config tree!&lt;/P&gt;

&lt;P&gt;The semi-problem:&lt;/P&gt;

&lt;P&gt;We're dumping JSON into log files on our servers. Everything is properly escaped and 1 JSON object appears per line in the logs.&lt;BR /&gt;
However, we noticed that Splunk has less records that our other logging stack.&lt;/P&gt;

&lt;P&gt;In searching, we realized that 80% or so of our events has a &lt;CODE&gt;linecount&lt;/CODE&gt; of 1, while others have 2-10 on average and one has 2000.&lt;/P&gt;

&lt;P&gt;I'm told I should create a new &lt;CODE&gt;sourcetype&lt;/CODE&gt; for my log files with a custom &lt;CODE&gt;LINE_BREAK&lt;/CODE&gt; so that Splunk correctly parses our 1 JSON object per Event.&lt;/P&gt;

&lt;P&gt;I'd like to know the following:&lt;/P&gt;

&lt;P&gt;1) What could be causing Splunk to not be able to parse my JSON logs, when others (td-agent/logstash) are able to no problem?&lt;/P&gt;

&lt;P&gt;2) Is there a key/value format (lots of text like stacktraces) which Splunk could do better with?&lt;/P&gt;

&lt;P&gt;3) If JSON is fine, what do I need to modify so that Splunk is able to parse my logs correctly?&lt;/P&gt;

&lt;P&gt;Thank you and apologies for the potential dups!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2015 18:19:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147974#M30099</guid>
      <dc:creator>lanceblais</dc:creator>
      <dc:date>2015-02-20T18:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk is indexing some of my json objects together in one event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147975#M30100</link>
      <description>&lt;P&gt;what is your input stanza for this; and are you defining any props/transforms for this data?&lt;/P&gt;

&lt;P&gt;is this coming from a forwarder or straight into a single splunk server/indexer/search head ?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2015 18:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147975#M30100</guid>
      <dc:creator>phoffman_splunk</dc:creator>
      <dc:date>2015-02-20T18:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk is indexing some of my json objects together in one event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147976#M30101</link>
      <description>&lt;P&gt;I haven't touched any config files.&lt;/P&gt;

&lt;P&gt;I setup the splunk forwarder for Ubuntu (this is a cloud install) and ran &lt;CODE&gt;splunk add monitor /path/to/file&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you want the output of some files, let me know.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2015 18:54:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147976#M30101</guid>
      <dc:creator>lanceblais</dc:creator>
      <dc:date>2015-02-20T18:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk is indexing some of my json objects together in one event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147977#M30102</link>
      <description>&lt;P&gt;Ans 1: Splunk's built-in sourcetype's have a definite attributes defined and if some of your events don't satisfy all the attributes, you can see random behavior like that. That's why for some non-standard logs, its recommended to create own sourcetype definitions to control the event parsing.&lt;/P&gt;

&lt;P&gt;Ans 2: Event parsing doesn't depend of whether its a key-value pair format of JSON. Key value pair format is only good for field extractions (not sure I understood your question, so ignore if it's irrelevant) &lt;/P&gt;

&lt;P&gt;Ans 3: You would have to explicitly configure event parsing (and preferably timestamp recongnition) in props.conf on Indexer/ Heavy Forwarder&lt;BR /&gt;
e.g. for JSON in following format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ "payload":{ "field1":"Value1", "field2":"Value2", "timestamp":"2015-02-18T13:38:57-0500" }, "event":[ { "field1":"Value1", "field2":"Value2",  "eventserial":"1EWehjkz", "timestamp":"2015-02-18T13:35:48-0500", "status":1 } ,{ "field1":"Value1", "field2":"Value2",  "eventserial":"1EWehjkz", "timestamp":"2015-02-18T13:35:48-0500", "status":2 } ] }

[YourSoureType]
pulldown_type = true
INDEXED_EXTRACTIONS = JSON
KV_MODE = none
BREAK_ONLY_BEFORE_DATE = false
BREAK_ONLY_BEFORE = {.*"payload"
TIME_PREFIX = \"timestamp\"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Feb 2015 20:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147977#M30102</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-02-20T20:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk is indexing some of my json objects together in one event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147978#M30103</link>
      <description>&lt;P&gt;Did you ever get this figured out? I'm having the same problem.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 19:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-is-indexing-some-of-my-json-objects-together-in-one-event/m-p/147978#M30103</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2016-01-18T19:02:12Z</dc:date>
    </item>
  </channel>
</rss>

