<?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 to get current time and convert to epoch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689800#M235015</link>
    <description>&lt;P&gt;There are a couple of functions to returns time, now() which returns the time the search started, and time() which returns the time the function is executed. Both of these functions already return the time in epoch format.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2024 06:28:05 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-06-06T06:28:05Z</dc:date>
    <item>
      <title>How to get current time and convert to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689797#M235012</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Is there a way to get current time on Splunk and then convert it to epoch? Im trying to create a dashboard to show inactivity from my data sources and plan to use info from | metadata command.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 06:06:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689797#M235012</guid>
      <dc:creator>jbv</dc:creator>
      <dc:date>2024-06-06T06:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current time and convert to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689800#M235015</link>
      <description>&lt;P&gt;There are a couple of functions to returns time, now() which returns the time the search started, and time() which returns the time the function is executed. Both of these functions already return the time in epoch format.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 06:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689800#M235015</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-06-06T06:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current time and convert to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689802#M235016</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263523"&gt;@jbv&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can get the current time using the now() function. By default it is returned in epoch&amp;nbsp; format only. You can use eval to call a field and you'll get what you want.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval current_time_epoch=now()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Tejas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;If the above solution helps, an upvote is appreciated.!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 06:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689802#M235016</guid>
      <dc:creator>tej57</dc:creator>
      <dc:date>2024-06-06T06:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current time and convert to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689803#M235017</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263523"&gt;@jbv&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you can use the now() funtion, for more infos see at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/DateandTimeFunctions" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/SearchReference/DateandTimeFunctions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval current_time=now()
| table current_time&lt;/LI-CODE&gt;&lt;P&gt;it's in epochtime, then you can convert in the format you like.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 06:29:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689803#M235017</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-06T06:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current time and convert to epoch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689820#M235020</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263523"&gt;@jbv&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 09:00:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-current-time-and-convert-to-epoch/m-p/689820#M235020</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-06-06T09:00:58Z</dc:date>
    </item>
  </channel>
</rss>

