<?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 do I include leading 0 in the time fields in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-include-leading-0-in-the-time-fields/m-p/28939#M4983</link>
    <description>&lt;P&gt;The best way if possible is to convert or use epoch time with in your search. Then use &lt;STRONG&gt;strftime&lt;/STRONG&gt; eval funtion to convert to the desired format.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
eval time = strftime(epoch,%H:%M:%S)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;additional reading:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Commontimeformatvariables"&gt;Commontimeformatvariables&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;CommonEvalFunctions&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this help or gets you started.  Dont forget to vote and accept answer that help.&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2013 17:21:49 GMT</pubDate>
    <dc:creator>bmacias84</dc:creator>
    <dc:date>2013-05-09T17:21:49Z</dc:date>
    <item>
      <title>How do I include leading 0 in the time fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-include-leading-0-in-the-time-fields/m-p/28938#M4982</link>
      <description>&lt;P&gt;I would like to combine the date_hour, date_minute and date_second fields to display in the following format when using the top command:  hh:mm:ss&lt;/P&gt;

&lt;P&gt;The problem I'm having is that the output will remove any leading zeros from the minutes; so, for example instead of 12:05:02 I get 12:5:2.&lt;/P&gt;

&lt;P&gt;This how I'm currently combining the fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch | eval time = date_hour.":".date_minute.":".date_second | top time,src,src_port,dest,dest_port
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:52:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-include-leading-0-in-the-time-fields/m-p/28938#M4982</guid>
      <dc:creator>digital_alchemy</dc:creator>
      <dc:date>2020-09-28T13:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I include leading 0 in the time fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-include-leading-0-in-the-time-fields/m-p/28939#M4983</link>
      <description>&lt;P&gt;The best way if possible is to convert or use epoch time with in your search. Then use &lt;STRONG&gt;strftime&lt;/STRONG&gt; eval funtion to convert to the desired format.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
eval time = strftime(epoch,%H:%M:%S)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;additional reading:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Commontimeformatvariables"&gt;Commontimeformatvariables&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;CommonEvalFunctions&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this help or gets you started.  Dont forget to vote and accept answer that help.&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2013 17:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-include-leading-0-in-the-time-fields/m-p/28939#M4983</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-05-09T17:21:49Z</dc:date>
    </item>
  </channel>
</rss>

