<?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: rex need help in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693672#M12544</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244235"&gt;@bhaskar5428&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes the regex is correct, but you need to put a quote before and after the regex in the rex command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = app_events_sdda_core_de_prod source="/home/sdda/apps/logs/sep-app/app-json.log" level=TRACE
| fields message
| rex field=message "\"error\":\{\"errorCode\":\"(?&amp;lt;errorCode&amp;gt;[^\"]+)\""
| dedup errorCode
| table errorCode&lt;/LI-CODE&gt;&lt;P&gt;otherwise the rex command gives an error.&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 06:32:16 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-07-18T06:32:16Z</dc:date>
    <item>
      <title>rex need help</title>
      <link>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693670#M12543</link>
      <description>&lt;P&gt;&amp;nbsp;message:&amp;nbsp;Send async response via rest [url=&lt;A href="https://prd.ase1.dbktp-feedloader.prd.gcp.db.com/callbackservice/book" target="_blank"&gt;https://prd.ase1.dbktp-feedloader.prd.gcp.db.com/callbackservice/book&lt;/A&gt;, asyncResp={"transactionItems":[{"itemId":"KTPACC1_20240717000001633206_01","status":"FAILED","accountIdentification":{"gtbCashAccount":{"branchCode":"788","accountNumber":"0191395050","currencyCode":"USD"}}},{"itemId":"KTPACC1_20240717000001633206_02","status":"FAILED","accountIdentification":{"gtbCashAccount":{"branchCode":"788","accountNumber":"0000195054","currencyCode":"USD"}}}],"orderStatusResponse":{"orderStatus":"ORDER_FAILURE","orderId":"KTPACC1_20240717000001633206"},"error":{"errorCode":"SEP013","errorDescription":"Cannot find IDMS-0788 account by accNumber: 0000195054"}}]&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;==================================================================================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;am using below query but its not giving me output , any idea&amp;nbsp;&lt;BR /&gt;index = app_events_sdda_core_de_prod source="/home/sdda/apps/logs/sep-app/app-json.log" level=TRACE&lt;BR /&gt;| fields message&lt;BR /&gt;| rex field=message \"error\":\{\"errorCode\":\"(?&amp;lt;errorCode&amp;gt;[^\"]+)\"&lt;BR /&gt;| dedup errorCode&lt;BR /&gt;| table errorCode&lt;BR /&gt;=====================================================================&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;However syntax showing correct on&amp;nbsp;&lt;A href="https://regex101.com/r/XkBntG/1" target="_blank" rel="noopener"&gt;https://regex101.com/r/XkBntG/1&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bhaskar5428_0-1721283926055.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31810iA83D1462C429716D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bhaskar5428_0-1721283926055.png" alt="bhaskar5428_0-1721283926055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 06:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693670#M12543</guid>
      <dc:creator>bhaskar5428</dc:creator>
      <dc:date>2024-07-18T06:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: rex need help</title>
      <link>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693672#M12544</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244235"&gt;@bhaskar5428&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes the regex is correct, but you need to put a quote before and after the regex in the rex command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = app_events_sdda_core_de_prod source="/home/sdda/apps/logs/sep-app/app-json.log" level=TRACE
| fields message
| rex field=message "\"error\":\{\"errorCode\":\"(?&amp;lt;errorCode&amp;gt;[^\"]+)\""
| dedup errorCode
| table errorCode&lt;/LI-CODE&gt;&lt;P&gt;otherwise the rex command gives an error.&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 06:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693672#M12544</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-18T06:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: rex need help</title>
      <link>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693673#M12545</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244235"&gt;@bhaskar5428&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 06:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693673#M12545</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-18T06:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: rex need help</title>
      <link>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693705#M12546</link>
      <description>&lt;P&gt;Adding to &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; 's answer.&lt;/P&gt;&lt;P&gt;A quote is not in itself a special character within a regex so within the regex itself it doesn't have to be escaped - on regex101 you could just do&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt; "error":\{"errorCode":"(?&amp;lt;errorCode&amp;gt;[^"]+)"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;(In this case you could also get away with not escaping the opening brace but it doesn't hurt and prevents accidental not-escaping when needed).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;But as you're putting the regex in a string as part of the command - then you need to escape your quotes as part of the string so the strings are not interpreted as the end of string. That's why you end up with (notice double backslash before opening brace&amp;nbsp; - you also need to escape the backslash if you want it to be literally included in the string)&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;"\"error\":\\{\"errorCode\":\"(?&amp;lt;errorCode&amp;gt;[^\"]+)\""&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 09:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/rex-need-help/m-p/693705#M12546</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-07-18T09:36:28Z</dc:date>
    </item>
  </channel>
</rss>

