<?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 lookahead issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/626044#M217600</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;for your quick replies!&amp;nbsp; Ultimately, Rich's search served my needs best.&amp;nbsp; One funny oddity, I needed to use the dash after the stanza as a delimiter and lookahead worked just fine in that capacity.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=calabrio MSG_VOICERECORDING_NOTIFY:SRC_NOTIFY_NO_PACKETS&lt;BR /&gt;| rex field=_raw "Filename\([\d-]+(?&amp;lt;phoneid&amp;gt;[A-Z]{3}.*&lt;STRONG&gt;(?=-)&lt;/STRONG&gt;)"&lt;BR /&gt;| stats count by phoneid&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2023 18:30:22 GMT</pubDate>
    <dc:creator>mikecal</dc:creator>
    <dc:date>2023-01-05T18:30:22Z</dc:date>
    <item>
      <title>How to use regex lookahead to capture the information from the 4th stanza of my log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/625919#M217568</link>
      <description>&lt;P&gt;I'm trying to use the following search to capture information regarding an identification code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=calabrio MSG_VOICERECORDING_NOTIFY:SRC_NOTIFY_NO_PACKETS
| rex field=_raw "Filename(?&amp;lt;phoneid&amp;gt;)(?=[A-Z][A-Z][A-Z]).*(?=-)"
| stats count by phoneid&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here an example of the log entry:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;2023&lt;/SPAN&gt;-01-04&lt;/SPAN&gt; &lt;SPAN class=""&gt;15:08:09.001175&lt;/SPAN&gt; &lt;SPAN class=""&gt;DEBUG&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;0xce4&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;VoiceRecorderUpdateTask.cpp&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;28&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;VoiceRecorderUpdateTask::runTask:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;MSG_VOICERECORDING_NOTIFY:SRC_NOTIFY_NO_PACKETS&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Filename&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;4281-1672873674000-4125-SEP12345678-98962688&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to capture the information from the 4th stanza.&amp;nbsp; I'm trying to use lookahead to target the three alpha characters.&amp;nbsp; This works as expected in regex101.com but Splunk is not producing any results.&amp;nbsp; I've read in several articles that lookahead doesn't work as you would expect it to but I haven't been able to piece together a search that will work.&amp;nbsp; Maybe I'm going about this the wrong way.&amp;nbsp; Any help is appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 04:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/625919#M217568</guid>
      <dc:creator>mikecal</dc:creator>
      <dc:date>2023-01-06T04:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Regex lookahead issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/625920#M217569</link>
      <description>&lt;P&gt;As you've read, Splunk does not do well with lookahead (or lookbehind).&amp;nbsp; Fortunately, lookahead rarely is necessary.&amp;nbsp; Try this regex to get the three letters in the Filename field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Filename\([\d-]+(?&amp;lt;phoneid&amp;gt;[A-Z]{3})&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Jan 2023 01:25:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/625920#M217569</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-01-05T01:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regex lookahead issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/625961#M217577</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/207603"&gt;@mikecal&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;i you want to extract the full phoneid, you can use :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=calabrio MSG_VOICERECORDING_NOTIFY:SRC_NOTIFY_NO_PACKETS
| rex "Filename\((?&amp;lt;phoneid&amp;gt;[^\)]+)"
| stats count by phoneid&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/o6MmDk/1" target="_blank"&gt;https://regex101.com/r/o6MmDk/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if you want only the last numbers, you can use&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=calabrio MSG_VOICERECORDING_NOTIFY:SRC_NOTIFY_NO_PACKETS
| rex "Filename\(\w+-\w+-\w+-\w+-(?&amp;lt;IBAN&amp;gt;[^\)]+)"
| stats count by phoneid&lt;/LI-CODE&gt;&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/o6MmDk/2" target="_blank"&gt;https://regex101.com/r/o6MmDk/2&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 08:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/625961#M217577</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-01-05T08:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regex lookahead issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/626044#M217600</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;for your quick replies!&amp;nbsp; Ultimately, Rich's search served my needs best.&amp;nbsp; One funny oddity, I needed to use the dash after the stanza as a delimiter and lookahead worked just fine in that capacity.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=calabrio MSG_VOICERECORDING_NOTIFY:SRC_NOTIFY_NO_PACKETS&lt;BR /&gt;| rex field=_raw "Filename\([\d-]+(?&amp;lt;phoneid&amp;gt;[A-Z]{3}.*&lt;STRONG&gt;(?=-)&lt;/STRONG&gt;)"&lt;BR /&gt;| stats count by phoneid&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 18:30:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-lookahead-to-capture-the-information-from-the/m-p/626044#M217600</guid>
      <dc:creator>mikecal</dc:creator>
      <dc:date>2023-01-05T18:30:22Z</dc:date>
    </item>
  </channel>
</rss>

