<?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: need help with rex to extract responseMessage as ==&amp;gt; Declined - Do not Honor so that I can stats count by rspCode and respMesage with detail in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502892#M139941</link>
    <description>&lt;P&gt;Hey Harish,&lt;/P&gt;

&lt;P&gt;Assuming you want everything in between responseMessage and orderId.&lt;BR /&gt;
You could use the below SPL.&lt;BR /&gt;
Replace your query in the line before the rex command.&lt;BR /&gt;
Please try and let us know&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        |makeresults
        |eval _raw ="2019-12-03 17:31:27.633 INFO ,aabbe872bbf3f848,aabbe872bbf3f848,false] 15 --- [nio-8080-exec-5] c.u.f.p.api.impl.: InfoLogging Operation=MakePayment, RequestSourceCode=ZBL, PaymentResponse=class PaymentResponse { responseCode: AB0000 responseMessage: Declined - Do not Honor orderId: 269107641 }"
        |rex field=_raw "responseMessage:(?P&amp;lt;response_message&amp;gt;.+)orderId"
        | table response_message
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Dec 2019 21:13:27 GMT</pubDate>
    <dc:creator>dindu</dc:creator>
    <dc:date>2019-12-09T21:13:27Z</dc:date>
    <item>
      <title>need help with rex to extract responseMessage as ==&gt; Declined - Do not Honor so that I can stats count by rspCode and respMesage with detail</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502890#M139939</link>
      <description>&lt;P&gt;2019-12-03 17:31:27.633 INFO ,aabbe872bbf3f848,aabbe872bbf3f848,false] 15 --- [nio-8080-exec-5] c.u.f.p.api.impl.: InfoLogging Operation=MakePayment, RequestSourceCode=ZBL, PaymentResponse=class PaymentResponse { responseCode: AB0000 responseMessage: &lt;STRONG&gt;Declined - Do not Honor&lt;/STRONG&gt; orderId: 269107641 } &lt;/P&gt;

&lt;P&gt;This is just n example .  With the rex query I want to list all codes with respMessage &lt;/P&gt;

&lt;P&gt;Below rex Query gets me respCode and respMessage part as only "Declined"     &lt;/P&gt;

&lt;P&gt;rex field=msg "responseCode: (?.[a-z0-9A-Z_-]+)"| rex field=msg "responseMessage: (?.[a-z0-9A-Z_-]+)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:17:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502890#M139939</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2020-09-30T03:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: need help with rex to extract responseMessage as ==&gt; Declined - Do not Honor so that I can stats count by rspCode and respMesage with detail</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502891#M139940</link>
      <description>&lt;P&gt;Assuming responseMessage is always followed by orderId, this should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=msg "responseCode: (?.[a-z0-9A-Z_-]+)"| rex field=msg "responseMessage: (?.[a-z0-9A-Z_-]+) orderId"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Dec 2019 20:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502891#M139940</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-12-09T20:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: need help with rex to extract responseMessage as ==&gt; Declined - Do not Honor so that I can stats count by rspCode and respMesage with detail</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502892#M139941</link>
      <description>&lt;P&gt;Hey Harish,&lt;/P&gt;

&lt;P&gt;Assuming you want everything in between responseMessage and orderId.&lt;BR /&gt;
You could use the below SPL.&lt;BR /&gt;
Replace your query in the line before the rex command.&lt;BR /&gt;
Please try and let us know&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        |makeresults
        |eval _raw ="2019-12-03 17:31:27.633 INFO ,aabbe872bbf3f848,aabbe872bbf3f848,false] 15 --- [nio-8080-exec-5] c.u.f.p.api.impl.: InfoLogging Operation=MakePayment, RequestSourceCode=ZBL, PaymentResponse=class PaymentResponse { responseCode: AB0000 responseMessage: Declined - Do not Honor orderId: 269107641 }"
        |rex field=_raw "responseMessage:(?P&amp;lt;response_message&amp;gt;.+)orderId"
        | table response_message
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Dec 2019 21:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502892#M139941</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2019-12-09T21:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: need help with rex to extract responseMessage as ==&gt; Declined - Do not Honor so that I can stats count by rspCode and respMesage with detail</title>
      <link>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502893#M139942</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw ="2019-12-03 17:31:27.633 INFO ,aabbe872bbf3f848,aabbe872bbf3f848,false] 15 --- [nio-8080-exec-5] c.u.f.p.api.impl.: InfoLogging Operation=MakePayment, RequestSourceCode=ZBL, PaymentResponse=class PaymentResponse { responseCode: AB0000 responseMessage: Declined - Do not Honor orderId: 269107641 }"
| rex mode=sed "s/(\w+): (.+?)(?= \w+\:| })/\"\1\": \"\2\",/g"
| rex "(?&amp;lt;json&amp;gt;\{.+\})"
| spath input=json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;make JSON by force.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 00:54:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/need-help-with-rex-to-extract-responseMessage-as-gt-Declined-Do/m-p/502893#M139942</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-26T00:54:15Z</dc:date>
    </item>
  </channel>
</rss>

