<?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 How to parse combined JSON and Syslog event? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-combined-JSON-and-Syslog-event/m-p/464571#M80100</link>
    <description>&lt;P&gt;I have an event that has a syslog preamble with a JSON body. &lt;BR /&gt;
They take this shape:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;190&amp;gt;0 2019-08-27T17:51:22.876570+00:00 ip-10-0-29-201 assurance-rails-staging 28462 - 6 info  {"method":"GET","path":"/agent/callbacks/refresh","format":"json","controller":"agent/lead_callbacks","action":"refresh","status":200,"duration":10.49,"view":0.56,"db":3.8,"params":{},"instance_id":"i-0fc05874277d98a0d","remote_ip":"27.34.111.207, 10.0.4.231"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The syslog parses wonderfully but the JSON does not. Is there an easy way to make this happen? Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2019 17:53:42 GMT</pubDate>
    <dc:creator>mzeb</dc:creator>
    <dc:date>2019-08-27T17:53:42Z</dc:date>
    <item>
      <title>How to parse combined JSON and Syslog event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-combined-JSON-and-Syslog-event/m-p/464571#M80100</link>
      <description>&lt;P&gt;I have an event that has a syslog preamble with a JSON body. &lt;BR /&gt;
They take this shape:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;190&amp;gt;0 2019-08-27T17:51:22.876570+00:00 ip-10-0-29-201 assurance-rails-staging 28462 - 6 info  {"method":"GET","path":"/agent/callbacks/refresh","format":"json","controller":"agent/lead_callbacks","action":"refresh","status":200,"duration":10.49,"view":0.56,"db":3.8,"params":{},"instance_id":"i-0fc05874277d98a0d","remote_ip":"27.34.111.207, 10.0.4.231"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The syslog parses wonderfully but the JSON does not. Is there an easy way to make this happen? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 17:53:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-combined-JSON-and-Syslog-event/m-p/464571#M80100</guid>
      <dc:creator>mzeb</dc:creator>
      <dc:date>2019-08-27T17:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse combined JSON and Syslog event?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-combined-JSON-and-Syslog-event/m-p/464572#M80101</link>
      <description>&lt;P&gt;Hi mzeb,&lt;/P&gt;

&lt;P&gt;based on the provided sample event you can setup props.conf and transforms.conf on your search head like this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [myTransform]
  REGEX = "([^"]+)":((?:[\d\.\{\}]+)|\"(?:[^"]+))
  FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mySourceType]
REPORT-myUniqueClassName = myTransform
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create new fields with names like &lt;CODE&gt;method&lt;/CODE&gt;,&lt;CODE&gt;path&lt;/CODE&gt; or &lt;CODE&gt;format&lt;/CODE&gt; and so on, with value like &lt;CODE&gt;GET&lt;/CODE&gt;,&lt;CODE&gt;/agent/callbacks/refresh&lt;/CODE&gt; or &lt;CODE&gt;json&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 02:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-combined-JSON-and-Syslog-event/m-p/464572#M80101</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-08-28T02:37:44Z</dc:date>
    </item>
  </channel>
</rss>

