<?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: Convert time from AM/PM to 24 Hour format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229228#M67888</link>
    <description>&lt;P&gt;This one worked &lt;/P&gt;

&lt;P&gt;| eval epochtime=strptime(Dtime, "%H:%M:%S")| eval DSyncTime=strftime(epochtime, "%I:%M:%S")&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2016 12:38:41 GMT</pubDate>
    <dc:creator>chandra61446</dc:creator>
    <dc:date>2016-03-02T12:38:41Z</dc:date>
    <item>
      <title>Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229222#M67882</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=* "please type serach keyword" host=xyz*
| rex field=_raw "^(?:[^ \n]* ){2}(?P\d+:\d+):\d+\s+\w+\s+\w+:\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\d+\s+(?P\d+:\d+)"]
| dedup host
| convert timeformat="%H:%M:%S" ctime(ServerTime) AS ST
| table ServerTime ST DeviceSyncTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1098i35E0DDD57EE4ABAC/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;ServerTime shows in AM/PM format and DeviceSyncTime shows in 24 hour format. How do I change the ServerTime field value to the 24 hour format? &lt;/P&gt;

&lt;P&gt;Note I don't want to have _time anywhere.. &lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 12:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229222#M67882</guid>
      <dc:creator>chandra61446</dc:creator>
      <dc:date>2016-03-01T12:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229223#M67883</link>
      <description>&lt;P&gt;Hi there chandra, try with this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval time24hs=strftime(ServerTime, "%H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 20:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229223#M67883</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-03-01T20:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229224#M67884</link>
      <description>&lt;P&gt;Where are you extracting ServerTime field and what is the format of the value (sample logs will be helpful)?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 20:59:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229224#M67884</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-01T20:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229225#M67885</link>
      <description>&lt;P&gt;Below id raw data &lt;/P&gt;

&lt;P&gt;[10A8:0564-151C] 03/01/2016 09:58:22 PM  Traveler: The last successful device sync was on Tue Mar 01 21:58:21 EST 2016.&lt;/P&gt;

&lt;P&gt;I am picking 09:58 as ServerTime abd 21:58 as DeviceSyncTime&lt;/P&gt;

&lt;P&gt;Now like to ServerTime to converted into 24hours format&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 06:39:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229225#M67885</guid>
      <dc:creator>chandra61446</dc:creator>
      <dc:date>2016-03-02T06:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229226#M67886</link>
      <description>&lt;P&gt;It did not help .. Below id raw data &lt;/P&gt;

&lt;P&gt;[10A8:0564-151C] 03/01/2016 09:58:22 PM  Traveler: The last successful device sync was on Tue Mar 01 21:58:21 EST 2016.&lt;/P&gt;

&lt;P&gt;I am picking 09:58 as ServerTime abd 21:58 as DeviceSyncTime&lt;/P&gt;

&lt;P&gt;Now like to ServerTime to converted into 24hours format&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 06:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229226#M67886</guid>
      <dc:creator>chandra61446</dc:creator>
      <dc:date>2016-03-02T06:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229227#M67887</link>
      <description>&lt;P&gt;Use _time instead ServerTime, like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval time24hs=strftime(_time, "%H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Mar 2016 12:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229227#M67887</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2016-03-02T12:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert time from AM/PM to 24 Hour format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229228#M67888</link>
      <description>&lt;P&gt;This one worked &lt;/P&gt;

&lt;P&gt;| eval epochtime=strptime(Dtime, "%H:%M:%S")| eval DSyncTime=strftime(epochtime, "%I:%M:%S")&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 12:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-time-from-AM-PM-to-24-Hour-format/m-p/229228#M67888</guid>
      <dc:creator>chandra61446</dc:creator>
      <dc:date>2016-03-02T12:38:41Z</dc:date>
    </item>
  </channel>
</rss>

