<?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: Issue with regex and 'positive lookbehind' in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548597#M155627</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Yes it's working. I had a strange bug, I modified &amp;lt;Rtn&amp;gt; by &amp;lt;alias&amp;gt; and it didn't work. Changed it again by &amp;lt;Rtn&amp;gt; or &amp;lt;Alias&amp;gt; or something else and it works...&lt;/P&gt;&lt;P&gt;So thank you, unfortunately I didn't expect that I could have data with a different format...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works perfectly with:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t h"&gt;16434800&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;SERVER6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;67965&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;SND_OK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;0000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;NbF=1&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;XXXRD.&lt;STRONG&gt;NN0015&lt;/STRONG&gt;.67965.SERVER1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;but of course not when I have:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;&lt;SPAN class="t h"&gt;16434800&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SERVER6&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;67965&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SND_OK&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;0000&lt;SPAN&gt; X00700086&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a "or" with a | but I'm still in pain with regex &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Apr 2021 14:33:24 GMT</pubDate>
    <dc:creator>Emp</dc:creator>
    <dc:date>2021-04-20T14:33:24Z</dc:date>
    <item>
      <title>Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548235#M155503</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm kind of new on the Splunk world and I'm trying to create new extraction field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are two examples of my logs.&lt;/P&gt;&lt;P&gt;14394300 SERVER1 02772 SND_OK 0000 NbF=1;TEST2N.&lt;STRONG&gt;02503&lt;/STRONG&gt;.02772.SERVER2;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t h"&gt;16434800&lt;/SPAN&gt; &lt;SPAN class="t"&gt;SERVER6&lt;/SPAN&gt; &lt;SPAN class="t"&gt;67965&lt;/SPAN&gt; &lt;SPAN class="t"&gt;SND_OK&lt;/SPAN&gt; &lt;SPAN class="t"&gt;0000&lt;/SPAN&gt; &lt;SPAN class="t"&gt;NbF=1&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;XXXRD.&lt;STRONG&gt;NN0015&lt;/STRONG&gt;.67965.SERVER1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I don't know how to extract the information in bold.&lt;/P&gt;&lt;P&gt;My extract/transform looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(?P&amp;lt;time&amp;gt;\d+)\s+(?P&amp;lt;sdr&amp;gt;\w*)\s+(?P&amp;lt;seq&amp;gt;[^ ]*)\s+(?P&amp;lt;status&amp;gt;[^ ]+)\s+(?P&amp;lt;errorCode&amp;gt;\d+)\s+(?P&amp;lt;Rtn&amp;gt;.+)&lt;/P&gt;&lt;P&gt;My fields work correctly for my use (and different cases) but now, I'm trying to be more accurate for &amp;lt;Rtn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Rtn&amp;gt; now is:&amp;nbsp;&lt;SPAN class="t"&gt;NbF=1&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;XXXRD.&lt;STRONG&gt;NN0015&lt;/STRONG&gt;.67965.SERVER1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;What I need is just the NN0015 or 02503.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;I tried with "positive lookbehind" or "positive lookahead" without any success.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Is it possible to have some help? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 14:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548235#M155503</guid>
      <dc:creator>Emp</dc:creator>
      <dc:date>2021-04-16T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548246#M155507</link>
      <description>&lt;P&gt;Lookbehind is not needed.&amp;nbsp; Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?P&amp;lt;time&amp;gt;\d+)\s+(?P&amp;lt;sdr&amp;gt;\w*)\s+(?P&amp;lt;seq&amp;gt;[^ ]*)\s+(?P&amp;lt;status&amp;gt;[^ ]+)\s+(?P&amp;lt;errorCode&amp;gt;\d+)\s+NbF=[^\.]+\.(?P&amp;lt;Rtn&amp;gt;[^\.]+)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Apr 2021 15:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548246#M155507</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-16T15:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548387#M155547</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;It's not working as expected.&lt;/P&gt;&lt;P&gt;It gave me in results:&amp;nbsp;&lt;STRONG&gt;&lt;SPAN class="t"&gt;NbF=1&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;SPAN class="t"&gt;&lt;STRONG&gt;XXXRD&lt;/STRONG&gt;.NN0015.67965.SERVER1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What I need is "&lt;SPAN class="t"&gt;NN0015". I will continue to search with your solution, I can maybe do something with it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 07:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548387#M155547</guid>
      <dc:creator>Emp</dc:creator>
      <dc:date>2021-04-19T07:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548443#M155565</link>
      <description>&lt;P&gt;Make sure you copied the regex correctly.&amp;nbsp; &amp;nbsp;"NbF" is not part of a capture group so you should not be getting that in a field.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 14:24:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548443#M155565</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-19T14:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548597#M155627</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Yes it's working. I had a strange bug, I modified &amp;lt;Rtn&amp;gt; by &amp;lt;alias&amp;gt; and it didn't work. Changed it again by &amp;lt;Rtn&amp;gt; or &amp;lt;Alias&amp;gt; or something else and it works...&lt;/P&gt;&lt;P&gt;So thank you, unfortunately I didn't expect that I could have data with a different format...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works perfectly with:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t h"&gt;16434800&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;SERVER6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;67965&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;SND_OK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;0000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;NbF=1&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;XXXRD.&lt;STRONG&gt;NN0015&lt;/STRONG&gt;.67965.SERVER1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;but of course not when I have:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;&lt;SPAN class="t h"&gt;16434800&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SERVER6&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;67965&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SND_OK&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;0000&lt;SPAN&gt; X00700086&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a "or" with a | but I'm still in pain with regex &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 14:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548597#M155627</guid>
      <dc:creator>Emp</dc:creator>
      <dc:date>2021-04-20T14:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548611#M155635</link>
      <description>&lt;P&gt;Which part of "&lt;SPAN class="t h"&gt;16434800&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SERVER6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;67965&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SND_OK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;X00700086&lt;/SPAN&gt;&lt;SPAN&gt;;" are you trying to extract?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sometimes, it's easier to use two separate &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; commands than to combine regular expressions.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 15:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548611#M155635</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-20T15:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548612#M155636</link>
      <description>&lt;P&gt;Case 1: 16434800 SERVER6 67965 SND_OK 0000 NbF=1;XXXRD.&lt;STRONG&gt;NN0015&lt;/STRONG&gt;.67965.SERVER1;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t h"&gt;Case 2: 16434800&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SERVER6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;67965&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SND_OK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0000&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;X00700086&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In both case, what's in bold is my &amp;lt;Rtn&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In case one, your first solution works perfectly but not on the case 2.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 15:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548612#M155636</guid>
      <dc:creator>Emp</dc:creator>
      <dc:date>2021-04-20T15:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548639#M155649</link>
      <description>&lt;P&gt;This works with the two sample events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?P&amp;lt;time&amp;gt;\d+)\s+(?P&amp;lt;sdr&amp;gt;\w*)\s+(?P&amp;lt;seq&amp;gt;[^ ]*)\s+(?P&amp;lt;status&amp;gt;[^ ]+)\s+(?P&amp;lt;errorCode&amp;gt;\d+)\s+(?:NbF=[^\.]+\.(?P&amp;lt;Rtn&amp;gt;[^\.]+)|(?&amp;lt;Rtn2&amp;gt;[^;]+))&lt;/LI-CODE&gt;&lt;P&gt;Select the Rtn field using &lt;FONT face="courier new,courier"&gt;coalesce&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | eval Rtn=coalesce(Rtn, Rtn2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 17:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548639#M155649</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-20T17:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with regex and 'positive lookbehind'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548768#M155680</link>
      <description>&lt;P&gt;I didn't know the&amp;nbsp;&lt;SPAN&gt;coalesce command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Works perfectly now with that. I just had to modify my dashboards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 12:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-regex-and-positive-lookbehind/m-p/548768#M155680</guid>
      <dc:creator>Emp</dc:creator>
      <dc:date>2021-04-21T12:22:15Z</dc:date>
    </item>
  </channel>
</rss>

