<?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: How to filter number from text with regular expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496346#M138330</link>
    <description>&lt;P&gt;As a first cut, add these lines to the end of your current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Periodic\sconnection\scheck\s\-\s(?&amp;lt;num_active_svcs_chkd&amp;gt;\d+)\sactive\sservices"
| rex field=_raw "NUMBER\sOF\sACTIVE\sservices\:\s(?&amp;lt;num_active_svcs&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you 2 new fields, &lt;STRONG&gt;num_active_svcs_chkd&lt;/STRONG&gt; and &lt;STRONG&gt;num_active_svcs&lt;/STRONG&gt;.  Theses names are completely arbitrary -- you can change them to suit your needs.&lt;/P&gt;

&lt;P&gt;Once you're happy with how these extractions are going, work with your Splunk admin to get these added into props.conf.&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;BR /&gt;
rmmiller&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:38:38 GMT</pubDate>
    <dc:creator>rmmiller</dc:creator>
    <dc:date>2020-09-30T04:38:38Z</dc:date>
    <item>
      <title>How to filter number from text with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496344#M138328</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I have two types of messages, I would like to receive the numbers from these logs  :&lt;/P&gt;

&lt;P&gt;2020-03-16 15:12:15,304      services/text123456: Periodic connection check - &lt;STRONG&gt;1659&lt;/STRONG&gt; active  services!&lt;BR /&gt;
2020-03-16 15:11:56,173      services/textabcdef: NUMBER OF ACTIVE services: &lt;STRONG&gt;1123&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thanks for help&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 14:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496344#M138328</guid>
      <dc:creator>dabroma5</dc:creator>
      <dc:date>2020-03-16T14:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter number from text with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496345#M138329</link>
      <description>&lt;P&gt;This regex works with your examples.  &lt;CODE&gt;(?:check - |services: )(?&amp;lt;services&amp;gt;\d+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 14:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496345#M138329</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-16T14:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter number from text with regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496346#M138330</link>
      <description>&lt;P&gt;As a first cut, add these lines to the end of your current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Periodic\sconnection\scheck\s\-\s(?&amp;lt;num_active_svcs_chkd&amp;gt;\d+)\sactive\sservices"
| rex field=_raw "NUMBER\sOF\sACTIVE\sservices\:\s(?&amp;lt;num_active_svcs&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you 2 new fields, &lt;STRONG&gt;num_active_svcs_chkd&lt;/STRONG&gt; and &lt;STRONG&gt;num_active_svcs&lt;/STRONG&gt;.  Theses names are completely arbitrary -- you can change them to suit your needs.&lt;/P&gt;

&lt;P&gt;Once you're happy with how these extractions are going, work with your Splunk admin to get these added into props.conf.&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;BR /&gt;
rmmiller&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-number-from-text-with-regular-expression/m-p/496346#M138330</guid>
      <dc:creator>rmmiller</dc:creator>
      <dc:date>2020-09-30T04:38:38Z</dc:date>
    </item>
  </channel>
</rss>

