<?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: Auto extract embedded JSON in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497133#M84758</link>
    <description>&lt;P&gt;Hi @jeremyhagand6,&lt;/P&gt;

&lt;P&gt;Your data doesn't seem like JSON since it starts with this header  &lt;CODE&gt;&amp;lt;134&amp;gt;2019-12-05T16:25:59.731796+11:00 HOSTNAME consolidated_audit:&lt;/CODE&gt;. In order to auto extract you have two choices :&lt;/P&gt;

&lt;P&gt;1- Extract the JSON part of your data into a field and use the spath command to auto extract all the fields. Details about the spath command here : &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath&lt;/A&gt;&lt;BR /&gt;
2- At index time, filter out this part of your data &lt;CODE&gt;&amp;lt;134&amp;gt;2019-12-05T16:25:59.731796+11:00 HOSTNAME consolidated_audit:&lt;/CODE&gt; your events will then be pure JSON and the KV extraction with work like a charm. This is only recommended if you're not using that part of your data at all and if you can find your hostname and timestamp in the data.&lt;/P&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2019 07:43:25 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-12-05T07:43:25Z</dc:date>
    <item>
      <title>How do I auto extract embedded JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497132#M84757</link>
      <description>&lt;P&gt;I have an event which looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;134&amp;gt;2019-12-05T16:25:59.731796+11:00 HOSTNAME consolidated_audit: {"affectedEntityList":[{"entityType":"vm","name":"TARGET","uuid":"62b439a7-6c7d-4274-ae35-db06435cec44"}],"alertUid":"VmUpdateAudit","classificationList":["UserAction"],"clientIp":"10.10.0.1","creationTimestampUsecs":"1575523555797505","defaultMsg":"Updated VM TARGET","opEndTimestampUsecs":"1575523555794928","opStartTimestampUsecs":"1575523555698501","operationType":"Update","originatingClusterUuid":"0005407a-59fe-d90d-7ac4-246e9610e720","params":{"annotation":"annotation","hardware_clock_timezone":"timezone","is_agent_vm":"false","memory_mb":"32768","num_cores_per_vcpu":"1","num_vcpus":"8","old_name":"TARGET","vm_name":"TARGET"},"recordType":"Audit","sessionId":"c2ba8526-84f2-4cd0-b1a4-7df762ffa353","severity":"Audit","userName":"admindigital61.jxh01","uuid":"193fd00b-513a-4c80-b40a-a73c6f69191e"}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'd like to configure auto-extraction of the embedded JSON. I've tried putting KV-MODE=json in props, but Splunk doesn't work it out for itself. I can do it with a combination of rex and pipe to spath in search, but I'd like the fields to be auto-extracted.&lt;/P&gt;
&lt;P&gt;Can anyone help?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 23:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497132#M84757</guid>
      <dc:creator>jeremyhagand61</dc:creator>
      <dc:date>2023-01-25T23:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Auto extract embedded JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497133#M84758</link>
      <description>&lt;P&gt;Hi @jeremyhagand6,&lt;/P&gt;

&lt;P&gt;Your data doesn't seem like JSON since it starts with this header  &lt;CODE&gt;&amp;lt;134&amp;gt;2019-12-05T16:25:59.731796+11:00 HOSTNAME consolidated_audit:&lt;/CODE&gt;. In order to auto extract you have two choices :&lt;/P&gt;

&lt;P&gt;1- Extract the JSON part of your data into a field and use the spath command to auto extract all the fields. Details about the spath command here : &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath"&gt;https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath&lt;/A&gt;&lt;BR /&gt;
2- At index time, filter out this part of your data &lt;CODE&gt;&amp;lt;134&amp;gt;2019-12-05T16:25:59.731796+11:00 HOSTNAME consolidated_audit:&lt;/CODE&gt; your events will then be pure JSON and the KV extraction with work like a charm. This is only recommended if you're not using that part of your data at all and if you can find your hostname and timestamp in the data.&lt;/P&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 07:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497133#M84758</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-05T07:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Auto extract embedded JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497134#M84759</link>
      <description>&lt;P&gt;Hey Jeremy,&lt;/P&gt;

&lt;P&gt;In order to parse the JSON automatically - you need to filter out the payload and then do the parsing.&lt;BR /&gt;
The payload is the actual data within the braces.&lt;BR /&gt;
We are extracting the data at the index time and then do an indexed extraction as described below.&lt;/P&gt;

&lt;P&gt;After adding the below configuration - perform a restart and check.&lt;BR /&gt;
Please try and let us know.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   Add the below lines to your sourcetype in props.conf.

   [your_source_type]
   INDEXED_EXTRACTIONS = json
   01_TRANSFORMS-transform_json_01 = transform_json_01

   Modify the transform.conf as below.


   [transform_json_01]
   REGEX = ^(?:[^\{]+)(.+$)
   FORMAT = $1
   DEST_KEY = _raw
   LOOKAHEAD = 50000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Dec 2019 17:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/497134#M84759</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2019-12-05T17:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Auto extract embedded JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/628348#M107848</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/68181"&gt;@DavidHourani&lt;/a&gt;, with #1, is there an ability to automate this, or does it have to be included in each search?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 21:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/628348#M107848</guid>
      <dc:creator>johnansett</dc:creator>
      <dc:date>2023-01-25T21:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Auto extract embedded JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/628416#M107849</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/167954"&gt;@johnansett&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The auto kv for JSON won't kick in unless the event is a JSON event (not a syslog event).&lt;/P&gt;&lt;P&gt;The simplest way to automate this is with "2". Especially if your timestamp is "in" the JSON event and not the one in the syslog header.&lt;/P&gt;&lt;P&gt;Another way to do this at search time is to use a Macro or eventtype instead of classic index=abc searches.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As a last resort (if you dont want to change the event from syslog to JSON) y&lt;/SPAN&gt;&lt;SPAN&gt;ou can even manually extract the field that you use the most and then make it a JSON event at search time when you need something that's not commonly used.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let me know if that helps.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 04:24:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-auto-extract-embedded-JSON/m-p/628416#M107849</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2023-01-26T04:24:54Z</dc:date>
    </item>
  </channel>
</rss>

