<?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 question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33889#M7232</link>
    <description>&lt;P&gt;This should do the trick for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Payload: (?P&amp;lt;YourField&amp;gt;[^\}]+\}){2}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Assuming that all your payloads only have 2 close curly brackets '}'&lt;/P&gt;

&lt;P&gt;Use the "interactive field extractor" view to test the regex before applying it (run your search &amp;gt; click the blue box next to one of the events &amp;gt; select "Extract Fields")&lt;/P&gt;

&lt;P&gt;EDIT:&lt;/P&gt;

&lt;P&gt;Change the value {2} from my above code to match the number of "closing curly brackets" '}' in your payload to have the regex work.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Feb 2013 15:22:49 GMT</pubDate>
    <dc:creator>aholzer</dc:creator>
    <dc:date>2013-02-15T15:22:49Z</dc:date>
    <item>
      <title>regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33888#M7231</link>
      <description>&lt;P&gt;I have the following log snippet with a JSON payload that includes a newline. How do I extract the entire JSON payload?&lt;/P&gt;

&lt;P&gt;ID: 123&lt;BR /&gt;
Payload: {&lt;BR /&gt;
  "info":{&lt;BR /&gt;
    "name":"bob",&lt;BR /&gt;
    "age":"35"&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Expected field should contain: &lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "info":{&lt;BR /&gt;
    "name":"bob",&lt;BR /&gt;
    "age":"35"&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 15:05:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33888#M7231</guid>
      <dc:creator>dbautist</dc:creator>
      <dc:date>2013-02-15T15:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33889#M7232</link>
      <description>&lt;P&gt;This should do the trick for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Payload: (?P&amp;lt;YourField&amp;gt;[^\}]+\}){2}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Assuming that all your payloads only have 2 close curly brackets '}'&lt;/P&gt;

&lt;P&gt;Use the "interactive field extractor" view to test the regex before applying it (run your search &amp;gt; click the blue box next to one of the events &amp;gt; select "Extract Fields")&lt;/P&gt;

&lt;P&gt;EDIT:&lt;/P&gt;

&lt;P&gt;Change the value {2} from my above code to match the number of "closing curly brackets" '}' in your payload to have the regex work.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 15:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33889#M7232</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-02-15T15:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33890#M7233</link>
      <description>&lt;P&gt;That's actually not the case. I have something like:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "test":{&lt;BR /&gt;
    "a":"b"&lt;BR /&gt;
    "c":{&lt;BR /&gt;
      "d":"e"&lt;BR /&gt;
    }&lt;BR /&gt;
  }&lt;BR /&gt;
  "e":{&lt;BR /&gt;
    "f":"g"&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 15:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33890#M7233</guid>
      <dc:creator>dbautist</dc:creator>
      <dc:date>2013-02-15T15:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: regex question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33891#M7234</link>
      <description>&lt;P&gt;As long as the number of "closing curly brackets" '}' is consistent across all your payloads, just count them and then change the {2} from my original post to the new number.&lt;/P&gt;

&lt;P&gt;So in your latest example the {2} should be changed to a {4}.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 15:35:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-question/m-p/33891#M7234</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-02-15T15:35:19Z</dc:date>
    </item>
  </channel>
</rss>

