<?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 break the json data into events? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242291#M46974</link>
    <description>&lt;P&gt;&lt;CODE&gt;(..)&lt;/CODE&gt; will tell splunk to take away the two characters before the opening curly bracket &lt;CODE&gt;{&lt;/CODE&gt;. In your data, that is either a space and an opening bracket &lt;CODE&gt;[&lt;/CODE&gt;, or a comma and a space. From props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* The regex must contain a capturing group -- a pair of parentheses which defines an identified subcomponent of the match.
* Wherever the regex matches, Splunk considers the start of the first capturing group to be the end of the previous event, and considers the end of the first capturing group to be the start of the next event.
* The contents of the first capturing group are discarded, and will not be present in any event.  You are telling Splunk that this text comes between lines.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These settings work for me, but I've encountered some strange behavior with the "Add Data" wizard from time to time. I'd suggest you set up and save your settings for the source type from the source type manager (Settings - Source Types) and select that saved source type during the "Add Data" wizard, that should make everything apply correctly even during that wizard.&lt;/P&gt;

&lt;P&gt;For completeness' sake, here are the settings you should definitely have for your sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = (..){"date"
SHOULD_LINEMERGE = false
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Nov 2015 12:10:30 GMT</pubDate>
    <dc:creator>jeffland</dc:creator>
    <dc:date>2015-11-30T12:10:30Z</dc:date>
    <item>
      <title>how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242286#M46969</link>
      <description>&lt;P&gt;Hello experts,below is the json data &lt;/P&gt;

&lt;P&gt;{"actions": [{"date": "2012-05-17 00:00:00", "action": "Read for the first time and referred to the Senate committee on Judiciary", "+amendment": null, "type": ["bill:reading:1", "committee:referred"], "actor": "upper"}, {"date": "2012-05-18 00:00:00", "action": "Read for the second time and placed on the calendar", "+amendment": null, "type": ["bill:reading:2"], "actor": "upper"}, {"date": "2012-05-21 00:00:00", "action": "Unfinished Business", "+amendment": null, "type": ["other"], "actor": "upper"}..................................&lt;/P&gt;

&lt;P&gt;I want to break the above data starting with a date into single events,Is that possible&lt;/P&gt;

&lt;P&gt;I tried using sourcetype=json and kv_mode=json but still it is not breaking .Please help&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 16:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242286#M46969</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-11-20T16:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242287#M46970</link>
      <description>&lt;P&gt;i want date,action,type,bill,commite,actor in one event&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 18:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242287#M46970</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-11-20T18:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242288#M46971</link>
      <description>&lt;P&gt;You can use this in props.conf to break your data into events starting with your date field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = (..){"date"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should try it out during the "Add Data" wizard to see if everything is as you want it to be.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 17:50:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242288#M46971</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-11-23T17:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242289#M46972</link>
      <description>&lt;P&gt;Hey Jeff thanks for the response&lt;/P&gt;

&lt;P&gt;(..) is this also needed to be added&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 22:05:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242289#M46972</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-11-23T22:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242290#M46973</link>
      <description>&lt;P&gt;I tried doing that...In the add data..set source type...but it is not showing only as a single event&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 22:11:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242290#M46973</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-11-23T22:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242291#M46974</link>
      <description>&lt;P&gt;&lt;CODE&gt;(..)&lt;/CODE&gt; will tell splunk to take away the two characters before the opening curly bracket &lt;CODE&gt;{&lt;/CODE&gt;. In your data, that is either a space and an opening bracket &lt;CODE&gt;[&lt;/CODE&gt;, or a comma and a space. From props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* The regex must contain a capturing group -- a pair of parentheses which defines an identified subcomponent of the match.
* Wherever the regex matches, Splunk considers the start of the first capturing group to be the end of the previous event, and considers the end of the first capturing group to be the start of the next event.
* The contents of the first capturing group are discarded, and will not be present in any event.  You are telling Splunk that this text comes between lines.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These settings work for me, but I've encountered some strange behavior with the "Add Data" wizard from time to time. I'd suggest you set up and save your settings for the source type from the source type manager (Settings - Source Types) and select that saved source type during the "Add Data" wizard, that should make everything apply correctly even during that wizard.&lt;/P&gt;

&lt;P&gt;For completeness' sake, here are the settings you should definitely have for your sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = (..){"date"
SHOULD_LINEMERGE = false
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Nov 2015 12:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242291#M46974</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-11-30T12:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242292#M46975</link>
      <description>&lt;P&gt;well I tried using your settings but the whole data is coming as one single event instead of breaking into multiple events.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 18:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242292#M46975</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-11-30T18:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242293#M46976</link>
      <description>&lt;P&gt;That's strange. If I paste your sample from above in a text document and try to index it with the above settings, they work. I'm on 6.3.1, but I doubt version will make a difference here.&lt;/P&gt;

&lt;P&gt;Maybe there are other characters in the original data?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 06:50:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242293#M46976</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-12-01T06:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242294#M46977</link>
      <description>&lt;P&gt;Name    Value   &lt;/P&gt;

&lt;P&gt;CHARSET=UTF-8&lt;/P&gt;

&lt;P&gt;INDEXED_EXTRACTIONS=json&lt;/P&gt;

&lt;P&gt;KV_MODE=JSON&lt;/P&gt;

&lt;P&gt;SHOULD_LINEMERGE=false&lt;/P&gt;

&lt;P&gt;category=Structured&lt;/P&gt;

&lt;P&gt;description=JavaScript Object Notation format. For more information, visit &lt;A href="http://json.org/"&gt;http://json.org/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;disabled=false&lt;/P&gt;

&lt;P&gt;pulldown_type=true&lt;/P&gt;

&lt;P&gt;LINE_BREAKER= (..){"date"&lt;/P&gt;

&lt;P&gt;the above is the setting I have done,is that fine or any changes needed&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 19:59:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242294#M46977</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-12-01T19:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242295#M46978</link>
      <description>&lt;P&gt;Almost. You don't need KV_MODE when you set INDEXED_EXTRACTIONS - the first one is for search time field extraction, which you don't need because you already have indexed extractions. Therefore, you should set KV_MODE = none.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242295#M46978</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2020-09-29T08:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242296#M46979</link>
      <description>&lt;P&gt;I have tried that too,but still the event summary still shows only one event&lt;/P&gt;

&lt;P&gt;Event Summary&lt;/P&gt;

&lt;P&gt;Sample size 10000 bytes&lt;BR /&gt;
Events  1&lt;BR /&gt;
Event time distribution&lt;BR /&gt;
0&lt;BR /&gt;
1&lt;BR /&gt;
5/17/12 12:00 AM: 1&lt;BR /&gt;
5/17/12 12:00 AM5/17/12 12:00 AM&lt;BR /&gt;
Number of lines per event&lt;/P&gt;

&lt;H1&gt;of lines  # of events % of events&lt;/H1&gt;

&lt;P&gt;1   1&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 17:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242296#M46979</guid>
      <dc:creator>chaseto</dc:creator>
      <dc:date>2015-12-02T17:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242297#M46980</link>
      <description>&lt;P&gt;Hm, I just noticed you have a space before the line breaker regex - if you remove that, restart your splunk and try to add the data once more, I don't know why it shouldn't work. It does on my machine.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 08:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242297#M46980</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-12-03T08:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to break the json data into events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242298#M46981</link>
      <description>&lt;P&gt;in splunk web when you onboard the file you will have option for selecting the sourcetype...i think in web structured section you have _json...if you select that particular type splunk automatically breaks the events&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 22:21:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-break-the-json-data-into-events/m-p/242298#M46981</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-03-03T22:21:36Z</dc:date>
    </item>
  </channel>
</rss>

