<?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 Help to convert a unix time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652327#M225464</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I use a | stats min(_time) as time_min stats max(_time) as time_max command in my search&lt;/P&gt;&lt;P&gt;The time is displayed in Unix format&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;Time_min=1688019886.761&lt;/P&gt;&lt;P&gt;Time-max=1690461727.136&lt;/P&gt;&lt;P&gt;I have added an eval time=strftime(_time, "%d-%m-%Y %H:%M" before the stats in order to convert the time but the result is sometimes strange because the max time is older than the min time&lt;/P&gt;&lt;P&gt;How to convert the time properly please?&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2023 08:26:12 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2023-07-28T08:26:12Z</dc:date>
    <item>
      <title>Help to convert a unix time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652327#M225464</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I use a | stats min(_time) as time_min stats max(_time) as time_max command in my search&lt;/P&gt;&lt;P&gt;The time is displayed in Unix format&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;Time_min=1688019886.761&lt;/P&gt;&lt;P&gt;Time-max=1690461727.136&lt;/P&gt;&lt;P&gt;I have added an eval time=strftime(_time, "%d-%m-%Y %H:%M" before the stats in order to convert the time but the result is sometimes strange because the max time is older than the min time&lt;/P&gt;&lt;P&gt;How to convert the time properly please?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 08:26:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652327#M225464</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-28T08:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help to convert a unix time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652330#M225465</link>
      <description>&lt;P&gt;Try this:&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats min(_time) as time_min max(_time) as time_max 
| convert ctime(time_min)
| convert ctime(time_max)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 08:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652330#M225465</guid>
      <dc:creator>jotne</dc:creator>
      <dc:date>2023-07-28T08:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help to convert a unix time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652336#M225468</link>
      <description>&lt;P&gt;You need your search above and it needs to contain the &lt;STRONG&gt;_time&lt;/STRONG&gt; field.&amp;nbsp; &amp;nbsp;Can you post your full SPL search?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your search&amp;gt;
| stats min(_time) as time_min max(_time) as time_max 
| convert ctime(time_min)
| convert ctime(time_max)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work with all Splunk installation:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| stats min(_time) as time_min max(_time) as time_max 
| convert ctime(time_min)
| convert ctime(time_max)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Jul 2023 09:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652336#M225468</guid>
      <dc:creator>jotne</dc:creator>
      <dc:date>2023-07-28T09:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help to convert a unix time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652338#M225470</link>
      <description>&lt;P&gt;Tha.ks it works&lt;/P&gt;&lt;P&gt;And now if i want to format the time i need to do an eval _time?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 09:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652338#M225470</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-07-28T09:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help to convert a unix time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652339#M225471</link>
      <description>&lt;P&gt;If you like a custom format, yes, then your need to use eval and not convert.&lt;/P&gt;&lt;P&gt;PS if you can accept the answer it would be fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 09:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-to-convert-a-unix-time/m-p/652339#M225471</guid>
      <dc:creator>jotne</dc:creator>
      <dc:date>2023-07-28T09:11:07Z</dc:date>
    </item>
  </channel>
</rss>

