<?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 on removing the double quotes and reading a substring in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615155#M213787</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 this regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Message\s+(?&amp;lt;Message1&amp;gt;.*)\s+Details\s+Message\s+(?&amp;lt;message2&amp;gt;.*)\s+Success&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/V015Wc/1" target="_blank"&gt;https://regex101.com/r/V015Wc/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Sep 2022 09:52:38 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-09-29T09:52:38Z</dc:date>
    <item>
      <title>Help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615099#M213758</link>
      <description>&lt;P&gt;I have the below string in my error log&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{"@odata.context":"&lt;A href="https://apistaging.payspace.com/odata/v1.1/11846/$metadata#EmployeePosition/$entity" target="_blank" rel="noopener"&gt;https://apistaging.payspace.com/odata/v1.1/11846/$metadata#EmployeePosition/$entity&lt;/A&gt;","Message":"Invalid value for field Directly reports to Employee Number.","Details":[{"Message":"Invalid value for field Directly reports to Employee Number."}],"Success":false}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have the code as shown below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;| makeresults&lt;BR /&gt;| eval test = "{"@odata.context":"&lt;A href="https://apistaging.payspace.com/odata/v1.1/11846/$metadata#EmployeePosition/$entity" target="_blank" rel="noopener"&gt;https://apistaging.payspace.com/odata/v1.1/11846/$metadata#EmployeePosition/$entity&lt;/A&gt;","&lt;STRONG&gt;Message":"Invalid value for field Directly reports to Employee Number.","Details":[{"Message":"Invalid value for field Directly reports to Employee Number."&lt;/STRONG&gt;}],"Success":false}"&lt;BR /&gt;| rex field=test max_match=0 "(?&amp;lt;test&amp;gt;\w+)"&lt;BR /&gt;| eval test = mvjoin (test, "-")&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now the code works by removing all the wild characters, but throws an error as I have double quotes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So need to know how i can ignore the quotes or replace it and then only need to get the string message which i have made in bold.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 14:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615099#M213758</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-29T14:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615102#M213760</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 log seems to be a json format, did you tried with the spath command?&lt;/P&gt;&lt;P&gt;Another question, what do you want to extract, the Message field?&lt;/P&gt;&lt;P&gt;if you want to extract the Message field you have to use a different regex:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=test "\"Message\":\"(?&amp;lt;message&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can test this regex at&amp;nbsp;&lt;A href="https://regex101.com/r/zk7QCa/1" target="_blank"&gt;https://regex101.com/r/zk7QCa/1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 06:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615102#M213760</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-29T06:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615151#M213784</link>
      <description>&lt;P&gt;Thanks&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;Yes this is JSON log.&amp;nbsp; I was able to remove the wild characters from the error log and got this now&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;odata context https apistaging payspace com odata v1 1 12082 metadata EmployeeEmploymentStatus entity&lt;STRONG&gt; Message&lt;/STRONG&gt; Committed transactions exist you may not change the employment date to a future date Committed transactions exist in the current records tax year you may not change the employment date Employment Date may not be after pay rate effective date or position effective date &lt;STRONG&gt;Details&lt;/STRONG&gt; &lt;STRONG&gt;Message&lt;/STRONG&gt; Committed transactions exist you may not change the employment date to a future date Message Committed transactions exist in the current records tax year you may not change the employment date Message Employment Date may not be after pay rate effective date or position effective date &lt;STRONG&gt;Success&lt;/STRONG&gt; false&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now i want to extract texts between &lt;STRONG&gt;Message&lt;/STRONG&gt;&amp;nbsp; and &lt;STRONG&gt;Details&lt;/STRONG&gt; and &lt;STRONG&gt;Message&lt;/STRONG&gt; and &lt;STRONG&gt;Success&lt;/STRONG&gt;.&amp;nbsp; These are fixed keywords, so need to extract the error message which are between these words.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 09:30:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615151#M213784</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-29T09:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615152#M213785</link>
      <description>&lt;P&gt;Also indicate the keyword &lt;STRONG&gt;Message&lt;/STRONG&gt; will repeat more than once in log as you see in the sample pasted&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 09:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615152#M213785</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-29T09:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615155#M213787</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 this regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Message\s+(?&amp;lt;Message1&amp;gt;.*)\s+Details\s+Message\s+(?&amp;lt;message2&amp;gt;.*)\s+Success&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/V015Wc/1" target="_blank"&gt;https://regex101.com/r/V015Wc/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 09:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615155#M213787</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-29T09:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615161#M213789</link>
      <description>&lt;P&gt;Thanks&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;It worked, Perfect thanks a lot. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 10:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615161#M213789</guid>
      <dc:creator>manojchacko78</dc:creator>
      <dc:date>2022-09-29T10:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615163#M213790</link>
      <description>&lt;P&gt;you need to correct the sourcetype for the json above it should json_no_timestamp&amp;nbsp; once you do that Splunk will auto put that message under message field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SinghK_0-1664448352960.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21763iEA4013DF4B1EE6FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SinghK_0-1664448352960.png" alt="SinghK_0-1664448352960.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 10:46:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615163#M213790</guid>
      <dc:creator>SinghK</dc:creator>
      <dc:date>2022-09-29T10:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on removing the double quotes and reading a substring</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615167#M213791</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;if one answer solves your need, please accept one answer for the other people of Community or tell us how we can help you.&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 by all the Contributors;-)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 10:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-removing-the-double-quotes-and-reading-a-substring/m-p/615167#M213791</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-29T10:58:31Z</dc:date>
    </item>
  </channel>
</rss>

