<?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 do index time extraction of multiple fields inside another field which is in json format? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575794#M101783</link>
    <description>&lt;P&gt;Here is the solution..&lt;/P&gt;&lt;P&gt;Referred these,&lt;/P&gt;&lt;P&gt;&lt;A title="Referred this" href="https://community.splunk.com/t5/Getting-Data-In/Extract-JSON-data-within-the-logs-JSON-mixed-with-unstructured/td-p/195292" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Getting-Data-In/Extract-JSON-data-within-the-logs-JSON-mixed-with-unstructured/td-p/195292&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Problem-with-using-SOURCE-KEY/m-p/40116" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Problem-with-using-SOURCE-KEY/m-p/40116&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[json_no_timestamp]&lt;BR /&gt;REPORT-json = report-json,report-json-kv&lt;BR /&gt;KV_MODE = none&lt;BR /&gt;INDEXED_EXTRACTIONS = json&lt;BR /&gt;LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;disabled = false&lt;BR /&gt;pulldown_type = true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[report-json]&lt;BR /&gt;SOURCE_KEY = message&lt;BR /&gt;REGEX = (?P&amp;lt;json2&amp;gt;{.+)&lt;/P&gt;&lt;P&gt;# Manually extract JSON key-value&lt;BR /&gt;[report-json-kv]&lt;BR /&gt;REGEX = \"(\w+)\":[\s]*\"([^\,\}\"]+)&lt;BR /&gt;FORMAT = $1::$2&lt;BR /&gt;SOURCE_KEY = json2&lt;/P&gt;</description>
    <pubDate>Sun, 21 Nov 2021 15:49:03 GMT</pubDate>
    <dc:creator>sivaranjiniG</dc:creator>
    <dc:date>2021-11-21T15:49:03Z</dc:date>
    <item>
      <title>How to do index time extraction of multiple fields inside another field which is in json format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575224#M101669</link>
      <description>&lt;P&gt;I have a field message which have values has json format need to extract all the values in the json.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{ [-]
   guessedService: ejj
   logGroup: /aws/ejj/cluster
   logStream: kube-apt-15444d2f8c4b216a9cb69ac
   message:{"kind":"Event","stage":"ResponseComplete","requestURI":"/api/v1/namespaces/jej/endpoints/eji.com-aws-eji","verb":"update","user":{"username":"system:serviceaccount:efs:efs-provisioner","uid":"ab5d27b4c-71a4f77323b0","groups":["system:serviceaccounts","system:serviceaccounts:eji","system:authenticated"]},"sourceIPs":["10.0.0.0"],"userAgent":"eji-provisioner/v0.0.0 (linux/amd64) kubernetes/$Format","objectRef":{"resource":"endpoints","namespace":"edd","name":"dds.com-aws-edds","uid":"44ad8-899f-fbc1f4befb2f","apiVersion":"v1","resourceVersion":"8852157"},"responseStatus":{"metadata":{},"code":200}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here from message field need to extract kind, stage,&amp;nbsp;requestURI... and these fields inside json are dynamic(it can be more in other event). need help in extracting these fields in index time using props and transforms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 08:56:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575224#M101669</guid>
      <dc:creator>sivaranjiniG</dc:creator>
      <dc:date>2021-11-17T08:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to do index time extraction of multiple fields inside another field which is in json format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575289#M101683</link>
      <description>&lt;P&gt;Any specific reason you need this as index-time extractions?&lt;/P&gt;&lt;P&gt;Any chance you could manipulate the overall format in which your receive the message?&amp;nbsp;If the rest of the log format would have been valid json (which it almost is), you could have simply used the INDEXED_EXTRACTIONS = json setting in props.conf.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 15:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575289#M101683</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2021-11-17T15:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to do index time extraction of multiple fields inside another field which is in json format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575778#M101778</link>
      <description>&lt;P&gt;we used spath in the query but its making the query heavy. thats the reason why trying to do it in the index time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the available solution helps in extraction if whole event i json. but couldnt find anything to extract a fields from another field.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 12:00:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575778#M101778</guid>
      <dc:creator>sivaranjiniG</dc:creator>
      <dc:date>2021-11-21T12:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to do index time extraction of multiple fields inside another field which is in json format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575794#M101783</link>
      <description>&lt;P&gt;Here is the solution..&lt;/P&gt;&lt;P&gt;Referred these,&lt;/P&gt;&lt;P&gt;&lt;A title="Referred this" href="https://community.splunk.com/t5/Getting-Data-In/Extract-JSON-data-within-the-logs-JSON-mixed-with-unstructured/td-p/195292" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Getting-Data-In/Extract-JSON-data-within-the-logs-JSON-mixed-with-unstructured/td-p/195292&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Problem-with-using-SOURCE-KEY/m-p/40116" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Problem-with-using-SOURCE-KEY/m-p/40116&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[json_no_timestamp]&lt;BR /&gt;REPORT-json = report-json,report-json-kv&lt;BR /&gt;KV_MODE = none&lt;BR /&gt;INDEXED_EXTRACTIONS = json&lt;BR /&gt;LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;disabled = false&lt;BR /&gt;pulldown_type = true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[report-json]&lt;BR /&gt;SOURCE_KEY = message&lt;BR /&gt;REGEX = (?P&amp;lt;json2&amp;gt;{.+)&lt;/P&gt;&lt;P&gt;# Manually extract JSON key-value&lt;BR /&gt;[report-json-kv]&lt;BR /&gt;REGEX = \"(\w+)\":[\s]*\"([^\,\}\"]+)&lt;BR /&gt;FORMAT = $1::$2&lt;BR /&gt;SOURCE_KEY = json2&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 15:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575794#M101783</guid>
      <dc:creator>sivaranjiniG</dc:creator>
      <dc:date>2021-11-21T15:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to do index time extraction of multiple fields inside another field which is in json format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575822#M101788</link>
      <description>&lt;P&gt;That isn't index-time, but ok, a REPORT based solution might still be preferred over spath in the query. Except for the fact that json is way to complex to parse with such a simple regex. It doesn't support nesting, it doesn't support arrays:&amp;nbsp;&lt;A href="https://regex101.com/r/PJQJp7/1" target="_blank"&gt;https://regex101.com/r/PJQJp7/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This would work a bit better already: "([^"]+)":\s*("[^"]+|\[[^]]*\]|\d+)&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/u8hgTB/1" target="_blank"&gt;https://regex101.com/r/u8hgTB/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But that also doesn't extract json the way Splunk's auto extraction would. My solution does take content of nested structures, but without retaining that structure, it just captures all the 'leaves' in the json tree.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 08:09:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-do-index-time-extraction-of-multiple-fields-inside/m-p/575822#M101788</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2021-11-22T08:09:28Z</dc:date>
    </item>
  </channel>
</rss>

