<?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: HELP!  Extracting JSON rex not working... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340120#M100880</link>
    <description>&lt;P&gt;Try this.. I just tested it and its working correctly &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tibco sourcetype="tibco:bw" environment=Prod "success":"*" "PartnerCheckSvc"
| rex success\":\"(?&amp;lt;Success&amp;gt;\w+)
 | rex resellerId\":\"(?&amp;lt;ResellerID&amp;gt;\d+)
 | rex message\":\"(?&amp;lt;Message&amp;gt;.+)(?=\")
 | stats values(Success) AS "Success" values(ResellerID) AS "ResellerID" values(Message) AS "Message" by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 21 Apr 2017 01:45:07 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2017-04-21T01:45:07Z</dc:date>
    <item>
      <title>HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340115#M100875</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I am trying new things and expanding my palate but having a problem extracting JSON.&lt;/P&gt;

&lt;P&gt;My Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tibco sourcetype="tibco:bw" environment=Prod "success":"*" "PartnerCheckSvc" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Parts of my output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;=-=-=-=-=-=-=-=-=-=-=-=-=
    &amp;lt;Output&amp;gt;
        &amp;lt;jsonString&amp;gt;{
      "success":"true",
      "resellerId":"36502703",
    }&amp;lt;/jsonString&amp;gt;
    &amp;lt;/Output&amp;gt;
=-=-=-=-=-=-=-=-=-=-=-=-=
&amp;lt;Output&amp;gt;
    &amp;lt;jsonString&amp;gt;{
  "success":"false",
  "errorCode":"RESELLERID_INVALID",
  "message":"Reseller ID not found. Please contact Reseller"
}&amp;lt;/jsonString&amp;gt;
&amp;lt;/Output&amp;gt; 
=-=-=-=-=-=-=-=-=-=-=-=-=
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've looked at the documentation but it's not displaying the way I'd like.  What is the best way of displaying this in a table?  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Success    resellerID      Message
True       36502703      
False                      Reseller ID not found. Please contact Reseller
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 17:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340115#M100875</guid>
      <dc:creator>leomedina</dc:creator>
      <dc:date>2017-04-20T17:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340116#M100876</link>
      <description>&lt;P&gt;You should use the &lt;CODE&gt;KV_MODE = json&lt;/CODE&gt; attribute in your &lt;CODE&gt;props.conf&lt;/CODE&gt;.. This will help with extracting fields &lt;/P&gt;

&lt;P&gt;Anyways, here's your answer with &lt;CODE&gt;rex&lt;/CODE&gt;.. This is untested &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tibco sourcetype="tibco:bw" environment=Prod "success":"*" "PartnerCheckSvc"
| rex success\":\"(?&amp;lt;Success&amp;gt;\w+)
 | rex resellerId\":\"(?&amp;lt;ResellerID&amp;gt;\d+)
 | rex message\":\"(?&amp;lt;Message&amp;gt;.+)(?=\")
 | stats values(Success) AS "Success" values(ResellerID) AS "ResellerID" values(Message) AS "Message" by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2017 18:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340116#M100876</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2017-04-20T18:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340117#M100877</link>
      <description>&lt;P&gt;Hi Skoelpin,&lt;/P&gt;

&lt;P&gt;It's not working...  &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; Is there another way of extracting this data? Maybe with spath?  I can't make the edits to the props.conf as that is managed by another team and would take an eternity to get approvals...&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 21:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340117#M100877</guid>
      <dc:creator>leomedina</dc:creator>
      <dc:date>2017-04-20T21:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340118#M100878</link>
      <description>&lt;P&gt;Remove line 5 and run the search again in smart-mode.. Do you get the Success, resllerID, and message field sin the Interesting fields section? &lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 22:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340118#M100878</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2017-04-20T22:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340119#M100879</link>
      <description>&lt;P&gt;Yes , but &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | stats values(Success) AS "Success" values(ResellerID) AS ResellerID values(Message) AS Message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;isn't displaying the data...  I even tried doing a &lt;CODE&gt;stats count&lt;/CODE&gt; but those didn't work.  I attempted &lt;CODE&gt;table&lt;/CODE&gt; but that didn't display any data.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 23:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340119#M100879</guid>
      <dc:creator>leomedina</dc:creator>
      <dc:date>2017-04-20T23:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340120#M100880</link>
      <description>&lt;P&gt;Try this.. I just tested it and its working correctly &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tibco sourcetype="tibco:bw" environment=Prod "success":"*" "PartnerCheckSvc"
| rex success\":\"(?&amp;lt;Success&amp;gt;\w+)
 | rex resellerId\":\"(?&amp;lt;ResellerID&amp;gt;\d+)
 | rex message\":\"(?&amp;lt;Message&amp;gt;.+)(?=\")
 | stats values(Success) AS "Success" values(ResellerID) AS "ResellerID" values(Message) AS "Message" by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 01:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340120#M100880</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2017-04-21T01:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!  Extracting JSON rex not working...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340121#M100881</link>
      <description>&lt;P&gt;Thank you, it works!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 06:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/HELP-Extracting-JSON-rex-not-working/m-p/340121#M100881</guid>
      <dc:creator>leomedina</dc:creator>
      <dc:date>2017-04-21T06:34:52Z</dc:date>
    </item>
  </channel>
</rss>

