<?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: Regular expression in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610772#M11601</link>
    <description>&lt;P&gt;Hi gcusello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;It is working and thanks for introducing new command as well to me..I will try to check documentation for spath command.&lt;BR /&gt;&lt;BR /&gt;Appreciate you for quick response&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 04:11:00 GMT</pubDate>
    <dc:creator>vineela</dc:creator>
    <dc:date>2022-08-25T04:11:00Z</dc:date>
    <item>
      <title>Help with regular expression to extract fields</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610646#M11599</link>
      <description>&lt;P&gt;I need to write regular expression to extract few fields in this, but not able to figure this out. Can you please help me on the same.&lt;/P&gt;
&lt;DIV class=""&gt;&lt;SPAN class=""&gt;X-Response-Timestamp:&lt;/SPAN&gt; &lt;SPAN class=""&gt;2022-08-24T07:27:26.150Z&lt;/SPAN&gt; &lt;SPAN class=""&gt;x-amzn-Remapped-Connection:&lt;/SPAN&gt; &lt;SPAN class=""&gt;close&lt;/SPAN&gt; &lt;SPAN class=""&gt;...&lt;/SPAN&gt; &lt;SPAN class=""&gt;4&lt;/SPAN&gt; &lt;SPAN class=""&gt;lines&lt;/SPAN&gt; &lt;SPAN class=""&gt;omitted&lt;/SPAN&gt; &lt;SPAN class=""&gt;...&lt;/SPAN&gt; &lt;SPAN class=""&gt;X-Amzn-Trace-Id:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Root=1-6305d2de-69ec840431ff21182b4a9f68&lt;/SPAN&gt; &lt;SPAN class=""&gt;Content-Type:&lt;/SPAN&gt; &lt;SPAN class=""&gt;application/json&lt;/SPAN&gt; {"&lt;SPAN class=""&gt;code&lt;/SPAN&gt;"&lt;SPAN class=""&gt;:&lt;/SPAN&gt;"APS&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;.MPI.20&lt;/SPAN&gt;19&lt;/SPAN&gt;","&lt;SPAN class=""&gt;severity&lt;/SPAN&gt;"&lt;SPAN class=""&gt;:&lt;/SPAN&gt;"&lt;SPAN class=""&gt;FATL&lt;/SPAN&gt;","&lt;SPAN class=""&gt;text&lt;/SPAN&gt;"&lt;SPAN class=""&gt;:&lt;/SPAN&gt;"&lt;SPAN class=""&gt;Invalid&lt;/SPAN&gt; &lt;SPAN class=""&gt;Request&lt;/SPAN&gt;","&lt;SPAN class=""&gt;user_message&lt;/SPAN&gt;"&lt;SPAN class=""&gt;:&lt;/SPAN&gt;"&lt;SPAN class=""&gt;Request&lt;/SPAN&gt; &lt;SPAN class=""&gt;id&lt;/SPAN&gt; &lt;SPAN class=""&gt;has&lt;/SPAN&gt; &lt;SPAN class=""&gt;already&lt;/SPAN&gt;&amp;nbsp;used&lt;SPAN class=""&gt;.&lt;/SPAN&gt;"}&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;Above is the whole log. I need to extract code,severity and message. I cant able t understand the format and fetch.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 14:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610646#M11599</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-08-24T14:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610647#M11600</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234209"&gt;@vineela&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;this seems to be a Json log, so you could try to use the spath command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath)" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Spath)&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;If anyway you want to use a regex, you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"code\":\"(?&amp;lt;code&amp;gt;[^\"]+)\",\"severity\":\"(?&amp;lt;severity&amp;gt;[^\"]+)\".*\"user_message\":\"(?&amp;lt;user_message&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/8Ggre7/1" target="_blank"&gt;https://regex101.com/r/8Ggre7/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 09:34:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610647#M11600</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-24T09:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610772#M11601</link>
      <description>&lt;P&gt;Hi gcusello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;It is working and thanks for introducing new command as well to me..I will try to check documentation for spath command.&lt;BR /&gt;&lt;BR /&gt;Appreciate you for quick response&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 04:11:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610772#M11601</guid>
      <dc:creator>vineela</dc:creator>
      <dc:date>2022-08-25T04:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610782#M11602</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234209"&gt;@vineela&lt;/a&gt;,&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, 25 Aug 2022 07:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-regular-expression-to-extract-fields/m-p/610782#M11602</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-25T07:12:44Z</dc:date>
    </item>
  </channel>
</rss>

