<?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: Issue with JSON event break regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231371#M68627</link>
    <description>&lt;P&gt;Please accept and upvote the answer if you think it helped.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 12:08:20 GMT</pubDate>
    <dc:creator>dmaislin_splunk</dc:creator>
    <dc:date>2016-10-05T12:08:20Z</dc:date>
    <item>
      <title>Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231361#M68617</link>
      <description>&lt;P&gt;I've been asked to ingest some JSON logs for auditing purposes but I can't get the event breaking right.  I'm pretty good with regex but this one is stumping me.  The regex shouldn't need to be complicated!&lt;/P&gt;

&lt;P&gt;Here's a snippet from the log.  I've truncated the content field with "..." as the content field can be quite large.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "_id" : "4befb832-6d00-44d6-8001-f4445a752a6f",
    "_t" : ["AuditEvent", "RequestEvent"],
    "AppId" : null,
    "UserId" : null,
    "Timestamp" : "2016-03-02T16:09:42.354Z",
    "RequestEventType" : 0,
    "RequestEventStatus" : 0,
    "Content" : "Email.AddToQueue::xxx@xxx.com::True::&amp;lt;?xml version=\"1.0\"..."
  }, {
    "_id" : "98dde3f0-f87a-49f5-822a-35862cc9ebfe",
    "_t" : ["AuditEvent", "CoopImportExportEvent"],
    "AppId" : "14f1d3b7-2bae-488c-8004-818adf991204",
    "Timestamp" : "2016-03-02T16:13:05.999Z",
    "UserAction" : 0,
    "UserActionTxt" : "DeleteAdhocLayer",
    "Notes" : "Adhoc layer: Import Regression Test - deleted ",
    "UserId" : "00000000-0000-0000-0000-000000000000",
    "UserName" : "xxx@xxx.com"
  }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I started with the simplest match which should achieve what I need i.e. BREAK_ONLY_BEFORE=\} and also without the escaping slash as I believe in PCRE it shouldn't be needed.&lt;/P&gt;

&lt;P&gt;Then tried increasing the regex pattern adding comma, space etc. followed by \"_id\" and other variations.  I've been messing around with MUST_BREAK_AFTER and BREAK_ONLY_BEFORE but I can't even get a partial match.  Really not sure what's going on with this one.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231361#M68617</guid>
      <dc:creator>stepheneardley</dc:creator>
      <dc:date>2020-09-29T11:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231362#M68618</link>
      <description>&lt;P&gt;On the forwarder you need to use a props.conf and leverage&lt;/P&gt;

&lt;P&gt;indexed_extractions=JSON&lt;/P&gt;

&lt;P&gt;Refer to &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/Propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Section:  Structured Data Header Extraction and configuration&lt;/P&gt;

&lt;P&gt;And yes, the forwarder, not the indexer is where the magic happens.&lt;/P&gt;

&lt;P&gt;As you see below, all fields, nice structure, syntax highlighting, ready to go.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1967i317150ECA03795CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 10:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231362#M68618</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-10-05T10:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231363#M68619</link>
      <description>&lt;P&gt;All line breaking, timestamp recognition and other important parsing steps are done on the forwarder and it also speeds up indexing and search results.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 10:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231363#M68619</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-10-05T10:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231364#M68620</link>
      <description>&lt;P&gt;Thanks dmaislin.  That'll help once I get my sourcetype built I'm sure but how do I go about building up my sourcetype now before deploying the inputs app with the additional props you've suggested?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 10:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231364#M68620</guid>
      <dc:creator>stepheneardley</dc:creator>
      <dc:date>2016-10-05T10:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231365#M68621</link>
      <description>&lt;P&gt;Try this in your props.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE=true
BREAK_ONLY_BEFORE=\{
TIME_PREFIX=Timestamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Oct 2016 11:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231365#M68621</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-05T11:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231366#M68622</link>
      <description>&lt;P&gt;Thanks sundareshr.  I already tried that and tried again just now but I'm still seeing "No results found." in the event summary.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 11:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231366#M68622</guid>
      <dc:creator>stepheneardley</dc:creator>
      <dc:date>2016-10-05T11:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231367#M68623</link>
      <description>&lt;P&gt;Inputs is not a app, but a simple inputs.conf file that will also be on the forwarder.&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[monitor:///var/log/file.json]&lt;BR /&gt;
sourcetype=MYJSON&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[MYJSON]&lt;BR /&gt;
INDEXED_EXTRACTIONS=JSON&lt;BR /&gt;
TIMESTAMP_FIELDS = Timestamp&lt;/P&gt;

&lt;P&gt;If you are new, just do it all locally as a test on a locally installed Splunk instance, like your laptop, go through the UI to add data, select structured data, and ensure you are monitoring the file.  Splunk will create the inputs and props for ya.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231367#M68623</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2020-09-29T11:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231368#M68624</link>
      <description>&lt;P&gt;I wouldn't go this route.  The newer approach is much faster, already extracts all field automagically, and speed up search and indexing.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 11:12:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231368#M68624</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-10-05T11:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231369#M68625</link>
      <description>&lt;P&gt;I updated my answer above with an image showing the data loaded into my local instance to give you context.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 11:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231369#M68625</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-10-05T11:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231370#M68626</link>
      <description>&lt;P&gt;That was very useful.  Thanks for that.  I'm trying it locally now.  We push everything out as an app.  Inputs, outputs etc. It's easier to deal with down the line.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 12:01:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231370#M68626</guid>
      <dc:creator>stepheneardley</dc:creator>
      <dc:date>2016-10-05T12:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231371#M68627</link>
      <description>&lt;P&gt;Please accept and upvote the answer if you think it helped.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 12:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231371#M68627</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-10-05T12:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231372#M68628</link>
      <description>&lt;P&gt;Perfect!  Worked a treat.  Thanks for taking the time to elaborate as well.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 12:20:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231372#M68628</guid>
      <dc:creator>stepheneardley</dc:creator>
      <dc:date>2016-10-05T12:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with JSON event break regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231373#M68629</link>
      <description>&lt;P&gt;Excellent!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 12:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-JSON-event-break-regex/m-p/231373#M68629</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-10-05T12:21:49Z</dc:date>
    </item>
  </channel>
</rss>

