<?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 on removing the double quotes and reading a substring in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615357#M213860</link>
    <description>&lt;P&gt;Now as the below code, all the wild characters are removed&lt;/P&gt;&lt;P&gt;| eval "EM"=if(isnotnull('cip:AuditMessage.MessageText'),'cip:AuditMessage.MessageText',"Data Not Found")&lt;BR /&gt;| rex field=EM max_match=0 "(?&amp;lt;ErrMes&amp;gt;\w+)"&lt;BR /&gt;| eval ErrorMessage = mvjoin (ErrMes, " ")&lt;BR /&gt;| rex field=ErrorMessage Message\s+(?&amp;lt;ErrorResponse&amp;gt;.*)\s+Details&lt;/P&gt;&lt;P&gt;I am getting the extracted message, so these are basically 4 error messages separated by commas, but since i am removing all the wild characters the comma is gone. So the commas should be extracted as it is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Nationality field is required The Province field is required The Code field is required The Country field is required&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Sep 2022 10:13:26 GMT</pubDate>
    <dc:creator>manojchacko78</dc:creator>
    <dc:date>2022-09-30T10:13:26Z</dc:date>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615332#M213856</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need one more help, from the below log, i am able to remove all the wild characters using below script, but need to retain the commas in the texts (in italics) between&amp;nbsp; &lt;STRONG&gt;Message&lt;/STRONG&gt; and &lt;STRONG&gt;Details&lt;/STRONG&gt;, similarly for &lt;STRONG&gt;Message&lt;/STRONG&gt; and &lt;STRONG&gt;Success&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Appreciate the help&lt;/P&gt;&lt;P&gt;| eval "EM"=if(isnotnull('cip:AuditMessage.MessageText'),'cip:AuditMessage.MessageText',"Data Not Found")&lt;BR /&gt;| rex field=EM max_match=0 "(?&amp;lt;ErrMes&amp;gt;\w+)"&lt;BR /&gt;| eval ErrorMessage = mvjoin (ErrMes, " ")&lt;BR /&gt;| rex field=ErrorMessage Message\s+(?&amp;lt;ErrorResponse&amp;gt;.*)\s+Details\s+Message\s+(?&amp;lt;ErrorResponse2&amp;gt;.*)\s+Success&lt;/P&gt;&lt;P&gt;{"@odata.context":"&lt;A href="https://apistaging.payspace.com/odata/v1.0/11997/$metadata#Employee/$entity" target="_blank"&gt;https://apistaging.payspace.com/odata/v1.0/11997/$metadata#Employee/$entity&lt;/A&gt;","&lt;STRONG&gt;Message&lt;/STRONG&gt;":"&lt;EM&gt;The Nationality field is required., The Province field is required., The Code field is required., The Country field is required.&lt;/EM&gt;&lt;SPAN&gt;","&lt;STRONG&gt;Details&lt;/STRONG&gt;":[{"&lt;STRONG&gt;Message&lt;/STRONG&gt;":"The Nationality field is required."},{"&lt;STRONG&gt;Message&lt;/STRONG&gt;":"The Province field is required."},{"Message":"The Code field is required."},{"Message":"The Country field is required."}],"&lt;STRONG&gt;Success&lt;/STRONG&gt;":false}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 08:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615332#M213856</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-30T08:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615340#M213857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249918"&gt;@manojchacko78&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;this isn't naother question, anyway, could you share the desidered output?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 08:56:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615340#M213857</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-30T08:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615351#M213858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;P&gt;This is what i am getting as raw&lt;/P&gt;&lt;P&gt;{"@odata.context":"&lt;A href="https://url.com" target="_blank"&gt;https://url.com&lt;/A&gt;","&lt;EM&gt;Message&lt;/EM&gt;":"&lt;SPAN&gt;&lt;STRONG&gt;The Nationality field is required., The Province field is required., The Code field is required., The Country field is required.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;","&lt;EM&gt;Details&lt;/EM&gt;":[{"Message":"The Nationality field is required."},{"Message":"The Province field is required."},{"Message":"The Code field is required."},{"Message":"The Country field is required."}],"Success":false}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now the bold text above is the desired output i am trying to extract. This bold texts always comes between these two words&amp;nbsp;&lt;STRONG&gt;Message":" &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;","Details&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kindly advise&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 09:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615351#M213858</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-30T09:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615354#M213859</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249918"&gt;@manojchacko78&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try thi regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\"Message\":\"(?&amp;lt;Message&amp;gt;[^\"]+)\",\"Details&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/8zMJIf/1" target="_blank"&gt;https://regex101.com/r/8zMJIf/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:00:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615354#M213859</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-30T10:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615357#M213860</link>
      <description>&lt;P&gt;Now as the below code, all the wild characters are removed&lt;/P&gt;&lt;P&gt;| eval "EM"=if(isnotnull('cip:AuditMessage.MessageText'),'cip:AuditMessage.MessageText',"Data Not Found")&lt;BR /&gt;| rex field=EM max_match=0 "(?&amp;lt;ErrMes&amp;gt;\w+)"&lt;BR /&gt;| eval ErrorMessage = mvjoin (ErrMes, " ")&lt;BR /&gt;| rex field=ErrorMessage Message\s+(?&amp;lt;ErrorResponse&amp;gt;.*)\s+Details&lt;/P&gt;&lt;P&gt;I am getting the extracted message, so these are basically 4 error messages separated by commas, but since i am removing all the wild characters the comma is gone. So the commas should be extracted as it is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Nationality field is required The Province field is required The Code field is required The Country field is required&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615357#M213860</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-30T10:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615360#M213861</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249918"&gt;@manojchacko78&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: you want to remove commas having one message field or you want four messages?&lt;/P&gt;&lt;P&gt;in the first case, you can use replace&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"Message\":\"(?&amp;lt;Full_Message&amp;gt;[^\"]+)\",\"Details"
| replace "," WITH ""&lt;/LI-CODE&gt;&lt;P&gt;if instead you want four messages you have to use two regexes, please try this regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"Message\":\"(?&amp;lt;Full_Message&amp;gt;[^\"]+)\",\"Details"
| rex field=Full_Message "((^)|(,\s+))(?&amp;lt;Message&amp;gt;[^\.]+)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615360#M213861</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-30T10:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615362#M213862</link>
      <description>&lt;P&gt;I have moved the post to new post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249918"&gt;@manojchacko78&lt;/a&gt;&amp;nbsp; please ask new questions in separate posts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Singhk&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:43:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615362#M213862</guid>
      <dc:creator>SinghK</dc:creator>
      <dc:date>2022-09-30T10:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615377#M213867</link>
      <description>&lt;P&gt;This one worked like a gem&lt;/P&gt;&lt;P&gt;| rex "\"Message\":\"(?&amp;lt;Full_Message&amp;gt;[^\"]+)\",\"Details"&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 12:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Re-Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615377#M213867</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-30T12:12:48Z</dc:date>
    </item>
  </channel>
</rss>

