<?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 extract days ,hours minutes and secs?? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368356#M108567</link>
    <description>&lt;P&gt;Here's one way...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval myfield1="11+09:45:25.591549" 
| eval myfield2=myfield1 
| rex mode=sed field=myfield2 "s/(\d+)\+(\d+):(\d+):(\d+).(\d+)/\1 days \2 hours \3 mins \4 secs/g"
| table myfield1 myfield2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above method assumes you will always have all pieces.  If you will occasionally have durations that are shorter than a day and have zero days, zero hours or whatever, then you need to define what you want to receive.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2017 07:20:57 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-12-29T07:20:57Z</dc:date>
    <item>
      <title>How to extract days ,hours minutes and secs??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368354#M108565</link>
      <description>&lt;P&gt;I have got the duration in  this format 11+09:45:25.591549.I want to convert it to 11 days 9 hours 45 mins 25 secs.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 06:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368354#M108565</guid>
      <dc:creator>chitreshakumar</dc:creator>
      <dc:date>2017-12-29T06:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract days ,hours minutes and secs??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368355#M108566</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;rex field=&amp;lt;duration_field_name&amp;gt; "(?&amp;lt;DAYS&amp;gt;\d+).(?&amp;lt;Hours&amp;gt;\d+).(?&amp;lt;Mins&amp;gt;\d+).(?&amp;lt;Secs&amp;gt;\d+)"|table DAYS, Hours, Mins, Secs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;replace &lt;CODE&gt;&amp;lt;duration_field_name&amp;gt;&lt;/CODE&gt; with your duration field name &lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 07:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368355#M108566</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2017-12-29T07:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract days ,hours minutes and secs??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368356#M108567</link>
      <description>&lt;P&gt;Here's one way...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval myfield1="11+09:45:25.591549" 
| eval myfield2=myfield1 
| rex mode=sed field=myfield2 "s/(\d+)\+(\d+):(\d+):(\d+).(\d+)/\1 days \2 hours \3 mins \4 secs/g"
| table myfield1 myfield2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above method assumes you will always have all pieces.  If you will occasionally have durations that are shorter than a day and have zero days, zero hours or whatever, then you need to define what you want to receive.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 07:20:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368356#M108567</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-29T07:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract days ,hours minutes and secs??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368357#M108568</link>
      <description>&lt;P&gt;Hi DalJeanis ,&lt;/P&gt;

&lt;P&gt;There are some field values like  this  00:00:10.000000  which I want to convert it to days , hours ,minutes and secs &lt;BR /&gt;
Any way we can add " "00+"  00:00:10.000000"&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 07:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368357#M108568</guid>
      <dc:creator>chitreshakumar</dc:creator>
      <dc:date>2017-12-29T07:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract days ,hours minutes and secs??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368358#M108569</link>
      <description>&lt;P&gt;That should be something like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | makeresults 
 | eval myfield1="11+09:45:25.591549 00:00:10.000000"
 | makemv myfield1
 | mvexpand myfield1 
 | eval myfield2=myfield1 
 | rex mode=sed field=myfield2 "s/((\d+)\+)?(\d+):(\d+):(\d+).(\d+)/\2 days \3 hours \4 mins \5 secs/g s/^ /0 /g s/00/0/g"
 | table myfield1 myfield2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Dec 2017 20:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-days-hours-minutes-and-secs/m-p/368358#M108569</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-30T20:47:09Z</dc:date>
    </item>
  </channel>
</rss>

