<?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 Get numbers in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461484#M191402</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I need to get numbers between event. &lt;BR /&gt;
1) event:  &lt;CODE&gt;Heap: 12.8G(15.0G), and 12.8 all the time is changing, and I need 15.0?&lt;/CODE&gt;&lt;BR /&gt;
need to get this number 15.0 .&lt;/P&gt;

&lt;P&gt;2)  Also for some reason, when I try  this search query  it shows no outputs. &lt;BR /&gt;
Event:&lt;BR /&gt;
&lt;CODE&gt;[Eden: 180.0M(6104.0M)-&amp;gt;0.0B(6104.0M) Survivors: 0.0B-&amp;gt;0.0B Heap: 3159.0M(12.0G)-&amp;gt;2979.3M(12.0G)], [Metaspace: 535433K-&amp;gt;535433K(1574912K)]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
&lt;CODE&gt;| rex Metaspace:\s(?\d+\.\d)\w | table metaspacenum | head 10&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;output in Statics there there is noting, just empty tables &lt;BR /&gt;
tried to exclude with &lt;CODE&gt;| search metaspacenum!=" "&lt;/CODE&gt;&lt;BR /&gt;
but it didn't helped!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2019 11:31:45 GMT</pubDate>
    <dc:creator>pudanelilita</dc:creator>
    <dc:date>2019-08-26T11:31:45Z</dc:date>
    <item>
      <title>Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461484#M191402</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I need to get numbers between event. &lt;BR /&gt;
1) event:  &lt;CODE&gt;Heap: 12.8G(15.0G), and 12.8 all the time is changing, and I need 15.0?&lt;/CODE&gt;&lt;BR /&gt;
need to get this number 15.0 .&lt;/P&gt;

&lt;P&gt;2)  Also for some reason, when I try  this search query  it shows no outputs. &lt;BR /&gt;
Event:&lt;BR /&gt;
&lt;CODE&gt;[Eden: 180.0M(6104.0M)-&amp;gt;0.0B(6104.0M) Survivors: 0.0B-&amp;gt;0.0B Heap: 3159.0M(12.0G)-&amp;gt;2979.3M(12.0G)], [Metaspace: 535433K-&amp;gt;535433K(1574912K)]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
&lt;CODE&gt;| rex Metaspace:\s(?\d+\.\d)\w | table metaspacenum | head 10&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;output in Statics there there is noting, just empty tables &lt;BR /&gt;
tried to exclude with &lt;CODE&gt;| search metaspacenum!=" "&lt;/CODE&gt;&lt;BR /&gt;
but it didn't helped!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 11:31:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461484#M191402</guid>
      <dc:creator>pudanelilita</dc:creator>
      <dc:date>2019-08-26T11:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461485#M191403</link>
      <description>&lt;P&gt;for 2 try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval x="[Eden: 180.0M(6104.0M)-&amp;gt;0.0B(6104.0M) Survivors: 0.0B-&amp;gt;0.0B Heap: 3159.0M(12.0G)-&amp;gt;2979.3M(12.0G)], [Metaspace: 535433K-&amp;gt;535433K(1574912K)]" 
|  rex field=x "Metaspace:(?&amp;lt;orig&amp;gt;.*?)\K-&amp;gt;"
|  rex field=x ".*\((?&amp;lt;new&amp;gt;.*?)\)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for 1, i think you added text to the event? where does Heap:.... end&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 11:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461485#M191403</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-26T11:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461486#M191404</link>
      <description>&lt;P&gt;You can extract the values like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|rex "Heap:\s+(?&amp;lt;field1&amp;gt;[^\(]+)\((?&amp;lt;field2&amp;gt;[^\)]+)\)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You can change field1 and field2 for whatever name you want to call the 12k part and the 15k part&lt;BR /&gt;
Validate your regex here:&lt;BR /&gt;
&lt;A href="https://regex101.com/r/pY9RJu/1"&gt;https://regex101.com/r/pY9RJu/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regarding your 2) your regex does not have a named capture group. so whatever field you're trying to filter results on does not exist. So its correct to show no results.&lt;BR /&gt;
Try this instead:&lt;BR /&gt;
&lt;CODE&gt;| rex Metaspace:\s(?&amp;lt;metaspacenum&amp;gt;[\d\.]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Check your regex here &lt;A href="https://regex101.com/r/Gp6vfD/1"&gt;https://regex101.com/r/Gp6vfD/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 11:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461486#M191404</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-08-26T11:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461487#M191405</link>
      <description>&lt;P&gt;Whichever solution you select, please consider making a macro to do your JVM metric extractions. We have such a solution, which is a series of rex statements, which produces a lot of useful fields.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 12:08:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461487#M191405</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-08-26T12:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461488#M191406</link>
      <description>&lt;P&gt;hint: why not create a TA with those regexes? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 17:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461488#M191406</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-08-26T17:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461489#M191407</link>
      <description>&lt;P&gt;Sure, a "Technology Add-on" is a great option to make them available to everyone. We happen to use macros for this case because they can be modified without admin involvement, and don't take up field storage space. One drawback is speed, but we use it infrequently so the trade-off is tolerable.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 18:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461489#M191407</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-08-26T18:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461490#M191408</link>
      <description>&lt;P&gt;hm.. what do you mean with field storage space? it will just move the extraction rex expressions from search spl to props/transforms making the extraction useful for everyone using the platform (depending on permissions ofc). IMO its easier to maintain and its easier to handle permissions than a macro is. &lt;/P&gt;

&lt;P&gt;Also It will only use more storage  space if you make them indexed extractions  which it doesn't need to be the case. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 11:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-numbers/m-p/461490#M191408</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2019-08-29T11:57:37Z</dc:date>
    </item>
  </channel>
</rss>

