<?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: Regex works on regex101 but not splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677143#M231542</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/264780"&gt;@syk19567&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it's a bug that I requested to solve for one of our biggest customers:&lt;/P&gt;&lt;P&gt;if you tested a regex containing a backslas in regex101 and it runs, to use this regex in a search you have to add other two backslashes to each backslash.&lt;/P&gt;&lt;P&gt;If instead you want to use this regex in a field extraction, you have to use the regex from regex1010 (the one with one backslash).&lt;/P&gt;&lt;P&gt;so the regex to use in a search is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\\\\\"submission_id\\\\\":(?&amp;lt;submission_id&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;instead the regex to use in the extract field (and regex101) is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\\\"submission_id\\\":(?P&amp;lt;submission_id&amp;gt;\d+)&lt;/LI-CODE&gt;&lt;P&gt;In addition, if you try to use the IFX on the same sourcetype, you have an error and you cannot use IFX.&lt;/P&gt;&lt;P&gt;As I said, I asked to solve this bug but they didn't give me a date.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 16:53:06 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-02-09T16:53:06Z</dc:date>
    <item>
      <title>Regex works on regex101 but not splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677140#M231539</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I'm using rex to get some strings.&lt;/P&gt;&lt;P&gt;The log is like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\"submission_id\":337901&lt;/LI-CODE&gt;&lt;P&gt;The regex I'm using is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\"submission_id\\\":(?&amp;lt;subID&amp;gt;\d+)&lt;/LI-CODE&gt;&lt;P&gt;It works well on regex101:&lt;BR /&gt;&lt;A href="https://regex101.com/r/Usr7Ki/1" target="_blank"&gt;https://regex101.com/r/Usr7Ki/1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;However, in Splunk, it doesn't find anything.&lt;BR /&gt;The command is (just added double quotes to wrap the regex)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rex "\"submission_id\\\":(?&amp;lt;subID&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Any ideas and suggestions are appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:39:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677140#M231539</guid>
      <dc:creator>syk19567</dc:creator>
      <dc:date>2024-02-09T16:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regex works on regex101 but not splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677142#M231541</link>
      <description>&lt;P&gt;You need to double up on some of your backslashes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\\\"submission_id\\\\\":(?&amp;lt;subID&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;Essentially, the rex command goes through a extra step of string parsing so backslashes have to be escaped an extra time&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677142#M231541</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-09T16:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regex works on regex101 but not splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677143#M231542</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/264780"&gt;@syk19567&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it's a bug that I requested to solve for one of our biggest customers:&lt;/P&gt;&lt;P&gt;if you tested a regex containing a backslas in regex101 and it runs, to use this regex in a search you have to add other two backslashes to each backslash.&lt;/P&gt;&lt;P&gt;If instead you want to use this regex in a field extraction, you have to use the regex from regex1010 (the one with one backslash).&lt;/P&gt;&lt;P&gt;so the regex to use in a search is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\\\\\"submission_id\\\\\":(?&amp;lt;submission_id&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;instead the regex to use in the extract field (and regex101) is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;\\\"submission_id\\\":(?P&amp;lt;submission_id&amp;gt;\d+)&lt;/LI-CODE&gt;&lt;P&gt;In addition, if you try to use the IFX on the same sourcetype, you have an error and you cannot use IFX.&lt;/P&gt;&lt;P&gt;As I said, I asked to solve this bug but they didn't give me a date.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:53:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677143#M231542</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-02-09T16:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Regex works on regex101 but not splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677144#M231543</link>
      <description>&lt;P&gt;This blows my mind and I'm kinda lost. But this really works!! Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:53:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677144#M231543</guid>
      <dc:creator>syk19567</dc:creator>
      <dc:date>2024-02-09T16:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regex works on regex101 but not splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677145#M231544</link>
      <description>Rule of thumb in splunk with rex. Add \-characters until it works &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Fri, 09 Feb 2024 16:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677145#M231544</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-02-09T16:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex works on regex101 but not splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677152#M231547</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;SPAN&gt;Giuseppe, this is very informative!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 17:31:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-works-on-regex101-but-not-splunk/m-p/677152#M231547</guid>
      <dc:creator>syk19567</dc:creator>
      <dc:date>2024-02-09T17:31:28Z</dc:date>
    </item>
  </channel>
</rss>

