<?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 Having trouble with rex matching wildcards with escaped double quotes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640859#M222034</link>
    <description>&lt;P class="lia-align-left"&gt;Hi there, I am having some trouble matching patterns from a search string using the rex command.&lt;/P&gt;&lt;P class="lia-align-left"&gt;I will show the message I am trying to search on, as well as several rex statements that I am using to find and extract certain bits of data (denoted by asterisks) into fields that I use in a table statement. rex statements matching wildcards populated by digits works fine, but I'm not able to match and extract data matching asterisks when they&amp;nbsp; are within quotes even if I escape them.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;STRONG&gt;| search Message="Error in breakfast table *, table name \"*\". The quick brown fox jumped over the lazy dog. The maximum length of the \"*\" data is currently set to * hotdogs, but the bun length is * inches. Increase the maximum length of the \"*\" bun to at least * inches and retry.*"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| rex "Error in breakfast table (?&amp;lt;breakfast_table&amp;gt;\d+)" | rename breakfast_table as "BT"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;STRONG&gt;| rex "table name \"(?&amp;lt;table_name&amp;gt;[^\"]*)\"" | rename table_name as "TN"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| rex "maximum length of the \"(?&amp;lt;max_bunlength&amp;gt;[^\"]*)\"" | rename max_bunlength as "MB"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;STRONG&gt;| rex "data is currently set to (?&amp;lt;current_length&amp;gt;\d+)" | rename current_length as "Current Length"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;I am able to pattern match correctly on asterisks because they just represent number values. I am having trouble with asterisks within double quotes. For example, a real message may show "AB" or "Z" but this line will not match it, even though I have confirmed on regex101 that it should be matching the letters AB or Z correctly -&amp;gt; &lt;STRONG&gt;| rex "table name \"(?&amp;lt;table_name&amp;gt;[^\"]*)\"" | rename table_name as "TN"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Any suggestions on this?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 16:03:14 GMT</pubDate>
    <dc:creator>weropitjpoerit</dc:creator>
    <dc:date>2023-04-20T16:03:14Z</dc:date>
    <item>
      <title>Having trouble with rex matching wildcards with escaped double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640859#M222034</link>
      <description>&lt;P class="lia-align-left"&gt;Hi there, I am having some trouble matching patterns from a search string using the rex command.&lt;/P&gt;&lt;P class="lia-align-left"&gt;I will show the message I am trying to search on, as well as several rex statements that I am using to find and extract certain bits of data (denoted by asterisks) into fields that I use in a table statement. rex statements matching wildcards populated by digits works fine, but I'm not able to match and extract data matching asterisks when they&amp;nbsp; are within quotes even if I escape them.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;STRONG&gt;| search Message="Error in breakfast table *, table name \"*\". The quick brown fox jumped over the lazy dog. The maximum length of the \"*\" data is currently set to * hotdogs, but the bun length is * inches. Increase the maximum length of the \"*\" bun to at least * inches and retry.*"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| rex "Error in breakfast table (?&amp;lt;breakfast_table&amp;gt;\d+)" | rename breakfast_table as "BT"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;STRONG&gt;| rex "table name \"(?&amp;lt;table_name&amp;gt;[^\"]*)\"" | rename table_name as "TN"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| rex "maximum length of the \"(?&amp;lt;max_bunlength&amp;gt;[^\"]*)\"" | rename max_bunlength as "MB"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;STRONG&gt;| rex "data is currently set to (?&amp;lt;current_length&amp;gt;\d+)" | rename current_length as "Current Length"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;I am able to pattern match correctly on asterisks because they just represent number values. I am having trouble with asterisks within double quotes. For example, a real message may show "AB" or "Z" but this line will not match it, even though I have confirmed on regex101 that it should be matching the letters AB or Z correctly -&amp;gt; &lt;STRONG&gt;| rex "table name \"(?&amp;lt;table_name&amp;gt;[^\"]*)\"" | rename table_name as "TN"&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Any suggestions on this?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 16:03:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640859#M222034</guid>
      <dc:creator>weropitjpoerit</dc:creator>
      <dc:date>2023-04-20T16:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with rex matching wildcards with escaped double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640890#M222052</link>
      <description>&lt;P&gt;To help with rex questions we really need to see example data.&amp;nbsp; Please share sanitized events.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 18:20:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640890#M222052</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-20T18:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with rex matching wildcards with escaped double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640904#M222059</link>
      <description>&lt;P&gt;I can't share the _raw event I used but I can mention how I was able to solve this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I went through the Extract New Fields process, highlighted the bit of information I needed like so -&amp;gt; \"&lt;FONT color="#FF0000"&gt;author&lt;/FONT&gt;\", viewed the generated regex, opened it in search so I could see the full |rex command that was generated, and used that.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 19:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-trouble-with-rex-matching-wildcards-with-escaped-double/m-p/640904#M222059</guid>
      <dc:creator>weropitjpoerit</dc:creator>
      <dc:date>2023-04-20T19:13:55Z</dc:date>
    </item>
  </channel>
</rss>

