<?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 Help - how to extract the numbers from string? in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647705#M754</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;For given sample data set, how can I extract all the numbers (will be always 3 digits) from desc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults
| eval desc="Frankfurt (123) &amp;amp; Saarbrucken (456), Germany - Primary down / Secondary down"
| append
[| makeresults 
| eval desc="Frankfurt (123), Saarbrucken (456), Frankfurt Zeil (789) &amp;amp; Kaiserslautern (012), Germany - Primary up / Secondary up"]
| append
[| makeresults 
| eval desc="Test - Creteil - (123) - France - Primary Up // Secondary Up"]
| append
[| makeresults 
| eval desc="All devices at 456 London, England are alerting as down and unreachable"]
| append
[| makeresults 
| eval desc="Test - 123-Clonmel ( Ireland) - Primary DOWN / Secondary UP/ Switch UP"]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output required:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="madhav_dholakia_0-1687328137734.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25934iE5A9BF85F84C3CF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="madhav_dholakia_0-1687328137734.png" alt="madhav_dholakia_0-1687328137734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can you please suggest regex I can use for the same?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 05:45:59 GMT</pubDate>
    <dc:creator>madhav_dholakia</dc:creator>
    <dc:date>2023-06-22T05:45:59Z</dc:date>
    <item>
      <title>RegEx Help - how to extract the numbers from string?</title>
      <link>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647705#M754</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;For given sample data set, how can I extract all the numbers (will be always 3 digits) from desc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults
| eval desc="Frankfurt (123) &amp;amp; Saarbrucken (456), Germany - Primary down / Secondary down"
| append
[| makeresults 
| eval desc="Frankfurt (123), Saarbrucken (456), Frankfurt Zeil (789) &amp;amp; Kaiserslautern (012), Germany - Primary up / Secondary up"]
| append
[| makeresults 
| eval desc="Test - Creteil - (123) - France - Primary Up // Secondary Up"]
| append
[| makeresults 
| eval desc="All devices at 456 London, England are alerting as down and unreachable"]
| append
[| makeresults 
| eval desc="Test - 123-Clonmel ( Ireland) - Primary DOWN / Secondary UP/ Switch UP"]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output required:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="madhav_dholakia_0-1687328137734.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25934iE5A9BF85F84C3CF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="madhav_dholakia_0-1687328137734.png" alt="madhav_dholakia_0-1687328137734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can you please suggest regex I can use for the same?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 05:45:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647705#M754</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2023-06-22T05:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help - how to extract the numbers from string</title>
      <link>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647707#M755</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65114"&gt;@madhav_dholakia&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try the below search?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
    | rex field=desc "(?&amp;lt;loc&amp;gt;\d+)" max_match=0
    | eval loc = mvjoin(loc,",")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval desc="Frankfurt (123) &amp;amp; Saarbrucken (456), Germany - Primary down / Secondary down" 
| append 
    [| makeresults 
    | eval desc="Frankfurt (123), Saarbrucken (456), Frankfurt Zeil (789) &amp;amp; Kaiserslautern (012), Germany - Primary up / Secondary up"] 
| append 
    [| makeresults 
    | eval desc="Test - Creteil - (123) - France - Primary Up // Secondary Up"] 
| append 
    [| makeresults 
    | eval desc="All devices at 456 London, England are alerting as down and unreachable"] 
| append 
    [| makeresults 
    | eval desc="Test - 123-Clonmel ( Ireland) - Primary DOWN / Secondary UP/ Switch UP"]
    | rex field=desc "(?&amp;lt;loc&amp;gt;\d+)" max_match=0
    | eval loc = mvjoin(loc,",")
|table loc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 06:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647707#M755</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-06-21T06:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help - how to extract the numbers from string</title>
      <link>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647708#M756</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| eval desc="Frankfurt (123) &amp;amp; Saarbrucken (456), Germany - Primary down / Secondary down"
| append
[| makeresults 
| eval desc="Frankfurt (123), Saarbrucken (456), Frankfurt Zeil (789) &amp;amp; Kaiserslautern (012), Germany - Primary up / Secondary up"]
| append
[| makeresults 
| eval desc="Test - Creteil - (123) - France - Primary Up // Secondary Up"]
| append
[| makeresults 
| eval desc="All devices at 456 London, England are alerting as down and unreachable"]
| append
[| makeresults 
| eval desc="Test - 123-Clonmel ( Ireland) - Primary DOWN / Secondary UP/ Switch UP"]
| rex max_match=0 field=desc "(?&amp;lt;loc&amp;gt;\d{3})"
| eval loc=mvjoin(loc,",")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Jun 2023 06:31:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647708#M756</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-21T06:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Help - how to extract the numbers from string</title>
      <link>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647728#M757</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;for prompt response. worked like a charm.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 08:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/RegEx-Help-how-to-extract-the-numbers-from-string/m-p/647728#M757</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2023-06-21T08:27:06Z</dc:date>
    </item>
  </channel>
</rss>

