<?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 convert time format in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741909#M21865</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to convert&amp;nbsp;&lt;SPAN&gt;2025-03-13T11:03:38Z to the&amp;nbsp;"%d/%m/%Y %I:%M:%S ".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried this, but it didn't work.&lt;BR /&gt;&lt;BR /&gt;| eval Lastevent=strftime(last_seen, "%d/%m/%Y %I:%M:%S %p")&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Mar 2025 16:59:20 GMT</pubDate>
    <dc:creator>Nraj87</dc:creator>
    <dc:date>2025-03-16T16:59:20Z</dc:date>
    <item>
      <title>How convert time format</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741909#M21865</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to convert&amp;nbsp;&lt;SPAN&gt;2025-03-13T11:03:38Z to the&amp;nbsp;"%d/%m/%Y %I:%M:%S ".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried this, but it didn't work.&lt;BR /&gt;&lt;BR /&gt;| eval Lastevent=strftime(last_seen, "%d/%m/%Y %I:%M:%S %p")&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Mar 2025 16:59:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741909#M21865</guid>
      <dc:creator>Nraj87</dc:creator>
      <dc:date>2025-03-16T16:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: How convert time format</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741914#M21866</link>
      <description>&lt;P&gt;Is last_seen a string? If so, try parsing it to convert it to an epoch time before formatting the result back to a different string.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Lastevent=strftime(strptime(last_seen, "%FT%T%Z"), "%d/%m/%Y %I:%M:%S %p")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Mar 2025 13:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741914#M21866</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-03-17T13:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: How convert time format</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741962#M21869</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253642"&gt;@Nraj87&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| makeresults &lt;BR /&gt;| eval last_seen = "2025-03-13T11:03:38Z" &lt;BR /&gt;| eval Lastevent = strftime(strptime(last_seen, "%Y-%m-%dT%H:%M:%SZ"), "%d/%m/%Y %I:%M:%S %p")&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kiran_panchavat_0-1742214234290.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38237i0DF4DF1DD356D6F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kiran_panchavat_0-1742214234290.png" alt="kiran_panchavat_0-1742214234290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 12:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741962#M21869</guid>
      <dc:creator>kiran_panchavat</dc:creator>
      <dc:date>2025-03-17T12:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: How convert time format</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741969#M21870</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253642"&gt;@Nraj87&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Check out the following, using makeresults to create a sample event:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1742218298466.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38239i90289A1BF270E61E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1742218298466.png" alt="livehybrid_0-1742218298466.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;| makeresults count=1&lt;BR /&gt;| fields - _time&lt;BR /&gt;| eval last_seen="2025-03-13T11:03:38Z" &lt;BR /&gt;| eval Lastevent=strftime(strptime(last_seen, "%Y-%m-%dT%H:%M:%SZ"), "%d/%m/%Y %I:%M:%S %p")&lt;/PRE&gt;&lt;P&gt;The reason your original command didn't work is because:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You need to first parse the input format using strptime&lt;/LI&gt;&lt;LI&gt;Then convert it to your desired format using strftime&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The strptime function tells Splunk how to read the input date format, similarly to the strftime&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;%Y: Full 4 digit Year with century (2025)&lt;/LI&gt;&lt;LI&gt;%m: Month (03)&lt;/LI&gt;&lt;LI&gt;%d: Day (13)&lt;/LI&gt;&lt;LI&gt;T: Literal 'T'&lt;/LI&gt;&lt;LI&gt;%H: Hour in 24-hour format (11)&lt;/LI&gt;&lt;LI&gt;%M: Minute (03)&lt;/LI&gt;&lt;LI&gt;%S: Second (38)&lt;/LI&gt;&lt;LI&gt;Z: Literal 'Z' for UTC timezone&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If you want to include AM/PM, keep the %p in the output format. If you don't need it, you can remove it - although you may wish to use %H to return 24hour format instead of %I for 12 hour format.&lt;/P&gt;&lt;P&gt;Please let me know how you get on and consider adding karma to this or any other answer if it has helped.&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Will&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 13:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-convert-time-format/m-p/741969#M21870</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-03-17T13:33:01Z</dc:date>
    </item>
  </channel>
</rss>

