<?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 How to get a numeric field extracted in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491867#M137266</link>
    <description>&lt;P&gt;I am trying to extract the "Time taken" from this field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-11-20 09:38:22,157 INFO Time taken: 01:35:53.514
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem I have is that when I use Splunk to create a regex it creates it as an "a". &lt;BR /&gt;
From what I understand that happens when more then half of the characters aren't numeric. &lt;BR /&gt;
As you can see there are 12 chars, 9 of which are numeric, so I am not sure why this field is created as an "a" and not a "#". &lt;/P&gt;

&lt;P&gt;Can anyone please help?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 21:49:23 GMT</pubDate>
    <dc:creator>Regleston</dc:creator>
    <dc:date>2019-11-20T21:49:23Z</dc:date>
    <item>
      <title>How to get a numeric field extracted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491867#M137266</link>
      <description>&lt;P&gt;I am trying to extract the "Time taken" from this field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-11-20 09:38:22,157 INFO Time taken: 01:35:53.514
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem I have is that when I use Splunk to create a regex it creates it as an "a". &lt;BR /&gt;
From what I understand that happens when more then half of the characters aren't numeric. &lt;BR /&gt;
As you can see there are 12 chars, 9 of which are numeric, so I am not sure why this field is created as an "a" and not a "#". &lt;/P&gt;

&lt;P&gt;Can anyone please help?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 21:49:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491867#M137266</guid>
      <dc:creator>Regleston</dc:creator>
      <dc:date>2019-11-20T21:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a numeric field extracted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491868#M137267</link>
      <description>&lt;P&gt;You can change the type, see &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/Knowledge/Definedatamodelattributes"&gt;link&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But why do you want to change it? The time taken is clearly not a number. How about parsing it apart and then doing calculations to render it into an actual numeric type, such as seconds?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 21:57:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491868#M137267</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2019-11-20T21:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a numeric field extracted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491869#M137268</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "Time taken:\s(?:(?:(?&amp;lt;duration_hours&amp;gt;\d+):)?(?&amp;lt;duration_minutes&amp;gt;\d+):)?(?&amp;lt;duration_seconds&amp;gt;.+)$"
| fillnull value=0 duration_hours duration_minutes 
| eval duration = duration_seconds + (60 * (duration_minutes + (60 * duration_hours))) 
| fieldformat duration = tostring(duration, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Nov 2019 22:09:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491869#M137268</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-20T22:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a numeric field extracted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491870#M137269</link>
      <description>&lt;P&gt;Thanks jpolvino &amp;amp; woodcock for the advice. I made regex for hh mm ss nnn and used the parsing woodcock provided and I am all smiles.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 21:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-numeric-field-extracted/m-p/491870#M137269</guid>
      <dc:creator>Regleston</dc:creator>
      <dc:date>2019-11-21T21:20:14Z</dc:date>
    </item>
  </channel>
</rss>

