<?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: regex101 to splunk rex translation insertion- Why isn't it working in splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595336#M207197</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241596"&gt;@Steve_A200&lt;/a&gt;&amp;nbsp;- As suggested by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; , you just use the regex part of it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/&amp;lt;regex&amp;gt;/&amp;lt;flags&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;g &amp;amp; m are flags for global and multiline, which is true by default for Splunk's rex command.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2022 06:17:20 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2022-04-26T06:17:20Z</dc:date>
    <item>
      <title>Why isn't regex101 to Splunk rex translation insertion working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595302#M207176</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I managed to get my regex101 expression working, however, I am not able to get it working in splunk.&amp;nbsp; I would like to extract only the location ID's that are listed in the _raw if they are preceded with the text "Location not found.ID: "&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test string:&lt;/P&gt;
&lt;P&gt;Location not found. ID: ABC000123244343&lt;/P&gt;
&lt;P&gt;Regex101 copied value:&lt;/P&gt;
&lt;P&gt;/[ABC0]\w+[a-zA-Z0-9]/gm&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when I tried the below in splunk it didn't provide me the results I expected:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| from datamodel:"xyzlogs"
| fields _raw
| where like(_raw,"%Location not found.ID: ABC000%")
| rex field=_raw "(?P&amp;lt;Location_id&amp;gt;/[ABC0]\w+[a-zA-Z0-9]/gm)"
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 15:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595302#M207176</guid>
      <dc:creator>Steve_A200</dc:creator>
      <dc:date>2022-04-26T15:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: regex101 to splunk rex translation insertion- Why isn't it working in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595303#M207177</link>
      <description>&lt;P&gt;You don't need everything from regex101, just the regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Location not found. ID: ABC000123244343"
| rex "(?P&amp;lt;Location_id&amp;gt;[ABC0]\w+[a-zA-Z0-9])"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:09:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595303#M207177</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-25T23:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: regex101 to splunk rex translation insertion- Why isn't it working in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595336#M207197</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241596"&gt;@Steve_A200&lt;/a&gt;&amp;nbsp;- As suggested by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; , you just use the regex part of it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/&amp;lt;regex&amp;gt;/&amp;lt;flags&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;g &amp;amp; m are flags for global and multiline, which is true by default for Splunk's rex command.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 06:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595336#M207197</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-26T06:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: regex101 to splunk rex translation insertion- Why isn't it working in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595339#M207198</link>
      <description>&lt;P&gt;Additionally, you can just include this "condition" in your regex.&lt;/P&gt;&lt;P&gt;But firstly make sure that your regex indeed does what you indend it to do.&lt;/P&gt;&lt;P&gt;Firstly you're looking for the string including "ABC000*", then you're matching against [ABC0] (that's a character class, not an explicit string).&lt;/P&gt;&lt;P&gt;What you need seems to be something more like&lt;/P&gt;&lt;PRE&gt;| rex field=_raw "Location\snot\sfound.ID:\s+(?&amp;lt;Location&amp;gt;ABC0\S+))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Which matches only those strings that start with ABC0 and are preceeded with "Location not found" string. Otherwise the regex will simply not match so it will not extract anything.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 06:28:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595339#M207198</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-26T06:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: regex101 to splunk rex translation insertion- Why isn't it working in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595421#M207225</link>
      <description>&lt;P&gt;Thank you for the prompt help, I found the best solution for my data logs was the suggestion below by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;&lt;PRE&gt;| rex field=_raw "Location\snot\sfound.ID:\s+(?&amp;lt;Location&amp;gt;ABC0\S+))&lt;/PRE&gt;&lt;P&gt;It was what I needed to extract.&lt;/P&gt;&lt;P&gt;Thank you all for your help, appreciate this community and the Talent it has.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 13:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-regex101-to-Splunk-rex-translation-insertion-working/m-p/595421#M207225</guid>
      <dc:creator>Steve_A200</dc:creator>
      <dc:date>2022-04-26T13:45:29Z</dc:date>
    </item>
  </channel>
</rss>

