<?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: RegEx to Parse Field Containing Json Format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472921#M133112</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="ValidFilterColumns=\"[{\"Id\":\"124\",\"Name\":\"OrderId\"},{\"Id\":\"25\",\"Name\":\"AssetClass\"},{\"Id\":\"123\",\"Name\":\"Custodian\"},{\"Id\":\"13\",\"Name\":\"Country\"},{\"Id\":\"1\",\"Name\":\"Symbol\"}]"
| rex max_match=0 "(?ms){\"Id\":\"(?&amp;lt;id&amp;gt;\d+)\",\"Name\":\"(?&amp;lt;Name&amp;gt;\w+)\"}"

| rex mode=sed "s/(.*)=\"(.*)\"/{\"\1\":\2}/"
| spath
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as you like.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Apr 2020 23:44:03 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-04-15T23:44:03Z</dc:date>
    <item>
      <title>RegEx to Parse Field Containing Json Format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472920#M133111</link>
      <description>&lt;P&gt;I am attempting to parse logs that contain fields similar to the example below. Field name being ValidFilterColumns, which contains an json format of these objects containing key/value pairs for Id and Name. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ValidFilterColumns="[{"Id":"124","Name":"OrderId"},{"Id":"25","Name":"AssetClass"},{"Id":"123","Name":"Custodian"},{"Id":"13","Name":"Country"},{"Id":"1","Name":"Symbol"}]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My question is, how could I compose a RegEx that parses out the Ids and Names of each object in the array? &lt;/P&gt;

&lt;P&gt;Also as a note: I have tried making the fields extracted fields, but they will only function properly if another log's field contains the same number of objects. &lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 21:23:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472920#M133111</guid>
      <dc:creator>ahaveles</dc:creator>
      <dc:date>2020-04-15T21:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx to Parse Field Containing Json Format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472921#M133112</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="ValidFilterColumns=\"[{\"Id\":\"124\",\"Name\":\"OrderId\"},{\"Id\":\"25\",\"Name\":\"AssetClass\"},{\"Id\":\"123\",\"Name\":\"Custodian\"},{\"Id\":\"13\",\"Name\":\"Country\"},{\"Id\":\"1\",\"Name\":\"Symbol\"}]"
| rex max_match=0 "(?ms){\"Id\":\"(?&amp;lt;id&amp;gt;\d+)\",\"Name\":\"(?&amp;lt;Name&amp;gt;\w+)\"}"

| rex mode=sed "s/(.*)=\"(.*)\"/{\"\1\":\2}/"
| spath
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as you like.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 23:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472921#M133112</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-15T23:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx to Parse Field Containing Json Format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472922#M133113</link>
      <description>&lt;P&gt;Sorry I am a bit lost, should these all be chained together in the search as they are above, or are lines 2 and 3 interchangeable with lines 5 and 6?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 13:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472922#M133113</guid>
      <dc:creator>ahaveles</dc:creator>
      <dc:date>2020-04-16T13:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx to Parse Field Containing Json Format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472923#M133114</link>
      <description>&lt;P&gt;no, not chain. Here is two method.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 20:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-to-Parse-Field-Containing-Json-Format/m-p/472923#M133114</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T20:32:55Z</dc:date>
    </item>
  </channel>
</rss>

