<?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 edit my search to convert values in seconds to days, hours, minutes, seconds, and milliseconds? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363112#M107264</link>
    <description>&lt;P&gt;i have values with seconds so i need to convert those into days, hours, minutes, seconds, and milliseconds. i am using this search but am getting 1 day extra. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval DurationReq_Resp=strftime(DurationReq_Resp, "%d day %Hh:%Mmin:%Ss.%3Nms")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help me in this?&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2017 16:50:32 GMT</pubDate>
    <dc:creator>prashanthberam</dc:creator>
    <dc:date>2017-03-21T16:50:32Z</dc:date>
    <item>
      <title>How to edit my search to convert values in seconds to days, hours, minutes, seconds, and milliseconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363112#M107264</link>
      <description>&lt;P&gt;i have values with seconds so i need to convert those into days, hours, minutes, seconds, and milliseconds. i am using this search but am getting 1 day extra. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval DurationReq_Resp=strftime(DurationReq_Resp, "%d day %Hh:%Mmin:%Ss.%3Nms")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help me in this?&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 16:50:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363112#M107264</guid>
      <dc:creator>prashanthberam</dc:creator>
      <dc:date>2017-03-21T16:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to convert values in seconds to days, hours, minutes, seconds, and milliseconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363113#M107265</link>
      <description>&lt;P&gt;Any partial days count as days, and negative durations are errors, so you basically can't mix days and hour/min/second in the same strftime and get a valid result.  Calculate the number of days separately and concatenate.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval DurationReq_Resp=floor(DurationReq_Resp/86400)." day ".strftime(DurationReq_Resp, "%Hh:%Mmin:%Ss.%3Nms")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Mar 2017 17:25:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363113#M107265</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-21T17:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to convert values in seconds to days, hours, minutes, seconds, and milliseconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363114#M107266</link>
      <description>&lt;P&gt;%d is the day of the month, so strftime might be getting confused. Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval DurationReq_Resp=tostring(DurationReq_Resp,"DurationReq_Resp") 
| eval DurationReq_RespMS=strftime(DurationReq_Resp,".%3N") 
| rex field=DurationReq_Resp mode=sed "s/\+/ days /" 
| rex field=DurationReq_Resp mode=sed "s/\d\:{1}/h:/" 
| rex field=DurationReq_Resp mode=sed "s/\d\:{1}/min:/" 
| rex field=DurationReq_Resp mode=sed "s/$/s/" 
| rex field=DurationReq_RespMS mode=sed "s/$/Ms/" 
| eval DurationReq_Resp=DurationReq_Resp+""+DurationReq_RespMS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it's a little lengthy, but i think it'll work for you.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 17:40:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363114#M107266</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-03-21T17:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to convert values in seconds to days, hours, minutes, seconds, and milliseconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363115#M107267</link>
      <description>&lt;P&gt;i think we need to calculate the hours also in this same way..&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 17:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363115#M107267</guid>
      <dc:creator>prashanthberam</dc:creator>
      <dc:date>2017-03-21T17:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to convert values in seconds to days, hours, minutes, seconds, and milliseconds?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363116#M107268</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval DurationReq_Resp=tostring(DurationReq_Resp, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Mar 2017 18:39:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-convert-values-in-seconds-to-days-hours/m-p/363116#M107268</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-21T18:39:16Z</dc:date>
    </item>
  </channel>
</rss>

