<?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 Regex : Extract text between first and second semi-colon from the right in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549241#M155832</link>
    <description>&lt;P&gt;Hello SMEs:&lt;/P&gt;&lt;P&gt;I need some assistance extracting everything between the 1st and 2nd semi-colon&amp;nbsp;; (&lt;STRONG&gt;FROM THE RIGHT&lt;/STRONG&gt;)&amp;nbsp; from a string like this:&amp;nbsp;&lt;STRONG&gt;SITES;Bypass;Whitelist;Finance;User Business Accept&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this case, the output would be &lt;STRONG&gt;Finance.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: text between the semi-colon's may change&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;</description>
    <pubDate>Sun, 25 Apr 2021 03:37:00 GMT</pubDate>
    <dc:creator>mdeterville</dc:creator>
    <dc:date>2021-04-25T03:37:00Z</dc:date>
    <item>
      <title>Regex : Extract text between first and second semi-colon from the right</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549241#M155832</link>
      <description>&lt;P&gt;Hello SMEs:&lt;/P&gt;&lt;P&gt;I need some assistance extracting everything between the 1st and 2nd semi-colon&amp;nbsp;; (&lt;STRONG&gt;FROM THE RIGHT&lt;/STRONG&gt;)&amp;nbsp; from a string like this:&amp;nbsp;&lt;STRONG&gt;SITES;Bypass;Whitelist;Finance;User Business Accept&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this case, the output would be &lt;STRONG&gt;Finance.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: text between the semi-colon's may change&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 03:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549241#M155832</guid>
      <dc:creator>mdeterville</dc:creator>
      <dc:date>2021-04-25T03:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex : Extract text between first and second semi-colon from the right</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549242#M155833</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/36182"&gt;@mdeterville&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The * quantifier is greedy by default. This should work:&lt;/P&gt;&lt;P&gt;| rex ".*;(?&amp;lt;value&amp;gt;.*);"&lt;/P&gt;&lt;P&gt;Try it &lt;A href="https://regex101.com/r/zgqarX/1" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 04:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549242#M155833</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-04-25T04:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex : Extract text between first and second semi-colon from the right</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549243#M155834</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp;Worked like a charm - Thanks for the quick response!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 04:16:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/549243#M155834</guid>
      <dc:creator>mdeterville</dc:creator>
      <dc:date>2021-04-25T04:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regex : Extract text between first and second semi-colon from the right</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/550692#M156278</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp; Ran into an issue where the data set also includes some categories only contains 1 Semi colon, similar to: "&lt;SPAN&gt;Business/Economy;User Accepted Business".&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea if &lt;STRONG&gt;OR&lt;/STRONG&gt; conditions can be used to combine the initial solution and another solution that grabs everything before the first semi-colon &lt;STRONG&gt;(FROM THE LEFT)&amp;nbsp;&lt;/STRONG&gt;when it finds fields with only one semi colon?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;-Mac&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 20:30:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/550692#M156278</guid>
      <dc:creator>mdeterville</dc:creator>
      <dc:date>2021-05-06T20:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regex : Extract text between first and second semi-colon from the right</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/550723#M156280</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/36182"&gt;@mdeterville&lt;/a&gt;&lt;/P&gt;&lt;P&gt;There are many (infinite!) ways to construct regular expressions. To capture everything between the first semicolon and either the second semicolon or the end of the line, you can use e.g.:&lt;/P&gt;&lt;P&gt;| rex ".*?;(?&amp;lt;value&amp;gt;[^;$]+);?"&lt;/P&gt;&lt;P&gt;$ is an anchor (a special token) representing the end of the string. The construct [^;$]+ means one or more characters not matching semicolon or end of string. The capture will stop when it encounters either of those characters.&lt;/P&gt;&lt;P&gt;You can plug the regular expression into regex101.com or another tool to test it with a step by step explanation.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 22:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extract-text-between-first-and-second-semi-colon-from-the/m-p/550723#M156280</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-05-06T22:38:44Z</dc:date>
    </item>
  </channel>
</rss>

