<?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 can I extract the nested JSON at index time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341258#M62899</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190967"&gt;@tkwaller&lt;/a&gt;&lt;BR /&gt;
Try this,&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
    [sourcetype]&lt;BR /&gt;
 TIME_FORMAT = %Y-%m-%d %H:%M:%S,%f&lt;BR /&gt;
 TRUNCATE = 100000&lt;BR /&gt;
 SHOULD_LINEMERGE = true&lt;BR /&gt;
 BREAK_ONLY_BEFORE_DATE = true&lt;BR /&gt;
 REPORT-json = report-json-kv&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[report-json-kv]&lt;BR /&gt;
CLEAN_KEYS = 0&lt;BR /&gt;
FORMAT = $1::$3&lt;BR /&gt;
MV_ADD = 1&lt;BR /&gt;
REGEX = \"(\w+)\":.(\"|)([a-z0-9-.A-Z:]+)&lt;BR /&gt;
SOURCE_KEY = _raw&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:33:24 GMT</pubDate>
    <dc:creator>sbbadri</dc:creator>
    <dc:date>2020-09-29T16:33:24Z</dc:date>
    <item>
      <title>How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341253#M62894</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I have some logs that have nested JSON. If I add INDEXED_EXTRACTIONS = JSON the non-JSON data does not appear but the JSON is expandable and extracted.&lt;/P&gt;

&lt;P&gt;Heres a sample of the log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-10-31 18:27:07,444 priority=INFO  app=apps thread=[stuff-2.0.177-v11111111].HttpsListenerConfig.worker.12 location=MessageProcessor line=151 _message="Message flow..." {appName=[stuff-2.0.177-v11111111, orderValue=10.00, field=1506373, retryCnt=0, field=12fdfg-123dsdf-213423vdc-dfg43, id=123456, field=123456789, field=2, field=220838349} responsePayload='{
  "field": 220838349,
  "field": 1292975431,
  "field": "1506373",
  "endTime": "2017-10-31T18:42:05.456Z",
  "field": true,
  "field": [
    {
      "field": -1,
      "field": "",
      "field": "31",
      "field": "27",
      "field": "16",
      "field": {
        "amount": 37.4,
        "currency": "USD"
      },
      "field": "HOLD"
    },
    {
      "field": -1,
      "field": "",
      "field": "31",
      "field": "27",
      "field": "17",
      "field": {
        "amount": 37.4,
        "currency": "USD"
      },
      "field": "HOLD"
    }
  ]
}' responseHttpStatus=200 timeTakenInMillis=2003
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My current props are&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [sourcetype]
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%f
TRUNCATE = 100000
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE_DATE = true
REPORT-json = report-json-kv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I added transforms&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[report-json-kv]       
REGEX = \"(\w+)\":[\s]*\"([^\,\}\"]+)
FORMAT = $1::$2
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is now that it does not extract the values within the JSON data.&lt;BR /&gt;
I tested with my regex extractor and it works there but not in splunk.&lt;BR /&gt;
Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 16:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341253#M62894</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2017-11-01T16:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341254#M62895</link>
      <description>&lt;P&gt;Recently I had a similar embedded json challenge at &lt;A href="https://answers.splunk.com/answers/581928/how-can-we-extract-a-json-document-within-an-event.html"&gt;How can we extract a json document within an event?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 16:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341254#M62895</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-11-01T16:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341255#M62896</link>
      <description>&lt;P&gt;Had similar issue &lt;A href="https://answers.splunk.com/answers/117121/extract-json-data-within-the-logs.html"&gt;https://answers.splunk.com/answers/117121/extract-json-data-within-the-logs.html&lt;/A&gt;&lt;BR /&gt;
Solved using props.conf and transforms.conf&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 16:50:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341255#M62896</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-11-01T16:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341256#M62897</link>
      <description>&lt;P&gt;So I updated the question with my new configs. It works in regex testers but doesnt extract in splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341256#M62897</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2017-11-02T14:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341257#M62898</link>
      <description>&lt;P&gt;From the UI you can use spath:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval myJson="{\"widget\": { \"text\": { \"data\": \"Click here\", \"size\": 36, \"data\": \"Learn more\", \"size\": 37, \"data\": \"Help\", \"size\": 38,}}" 
| spath input=myJson
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341257#M62898</guid>
      <dc:creator>valiquet</dc:creator>
      <dc:date>2017-11-02T14:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341258#M62899</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190967"&gt;@tkwaller&lt;/a&gt;&lt;BR /&gt;
Try this,&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
    [sourcetype]&lt;BR /&gt;
 TIME_FORMAT = %Y-%m-%d %H:%M:%S,%f&lt;BR /&gt;
 TRUNCATE = 100000&lt;BR /&gt;
 SHOULD_LINEMERGE = true&lt;BR /&gt;
 BREAK_ONLY_BEFORE_DATE = true&lt;BR /&gt;
 REPORT-json = report-json-kv&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[report-json-kv]&lt;BR /&gt;
CLEAN_KEYS = 0&lt;BR /&gt;
FORMAT = $1::$3&lt;BR /&gt;
MV_ADD = 1&lt;BR /&gt;
REGEX = \"(\w+)\":.(\"|)([a-z0-9-.A-Z:]+)&lt;BR /&gt;
SOURCE_KEY = _raw&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341258#M62899</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T16:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341259#M62900</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I removed the indexed data and the index, updated the configs with yours and the re-added the data but its still not extracting the fields. I DID test your regex and it IS correct but its still not working&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 15:21:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/341259#M62900</guid>
      <dc:creator>tkwaller</dc:creator>
      <dc:date>2017-11-03T15:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract the nested JSON at index time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/549725#M91302</link>
      <description>&lt;P&gt;Are you sending the JSON to HEC? if you want to do custom extraction at index time, make sure you use the HEC URL ending in /collector/raw.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you use /collector (or /collector/event) endpoint, then it is probably bypassing some customizations.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 01:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-the-nested-JSON-at-index-time/m-p/549725#M91302</guid>
      <dc:creator>swebb07g</dc:creator>
      <dc:date>2021-04-29T01:48:03Z</dc:date>
    </item>
  </channel>
</rss>

