{"id":23133,"date":"2020-10-09T14:52:18","date_gmt":"2020-10-09T14:52:18","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=23133"},"modified":"2020-10-09T14:52:18","modified_gmt":"2020-10-09T14:52:18","slug":"answer-by-warren-for-epoch-time-conversion-to-time-in-splunk","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=23133","title":{"rendered":"Answer by warren for Epoch time conversion to time in Splunk"},"content":{"rendered":"<p><em>Typically<\/em>, you&#8217;d convert from the timestamp (ie epoch time) to something human-readable in your search<\/p>\n<p>Like this:<\/p>\n<pre><code>index=ndx sourcetype=srctp earliest=-4h\n| stats max(_time) as rtime min(_time) as etime by fieldA\n| sort 0 - rtime + fieldA\n| eval rtime=strftime(rtime,&quot;%c&quot;), etime=strftime(etime,&quot;%c&quot;)\n| rename rtime as &quot;Most Recent&quot; etime as &quot;Earliest&quot;\n<\/code><\/pre>\n<p>Splunk <code>strftime<\/code> docs: <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/8.0.6\/SearchReference\/DateandTimeFunctions#strftime.28X.2CY.29\" rel=\"nofollow noreferrer\">https:\/\/docs.splunk.com\/Documentation\/Splunk\/8.0.6\/SearchReference\/DateandTimeFunctions#strftime.28X.2CY.29<\/a><\/p>\n<p>Further formatting info for <code>strptime<\/code> and <code>strftime<\/code>: <a href=\"https:\/\/strftime.org\" rel=\"nofollow noreferrer\">https:\/\/strftime.org<\/a><\/p>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/64269848\/epoch-time-conversion-to-time-in-splunk\/64282363#64282363<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Typically, you&#8217;d convert from the timestamp (ie epoch time) to something human-readable in your search Like this: index=ndx sourcetype=srctp earliest=-4h | stats max(_time) as rtime min(_time) as etime by fieldA | sort 0 &#8211; rtime + fieldA | eval rtime=strftime(rtime,&quot;%c&quot;), etime=strftime(etime,&quot;%c&quot;) | rename rtime as &quot;Most Recent&quot; etime as &quot;Earliest&quot; Splunk strftime docs: https:\/\/docs.splunk.com\/Documentation\/Splunk\/8.0.6\/SearchReference\/DateandTimeFunctions#strftime.28X.2CY.29 Further &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=23133\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Epoch time conversion to time in Splunk<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[991],"keyring_services":[],"class_list":["post-23133","post","type-post","status-publish","format-standard","hentry","category-blih","tag-stackexchange"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/23133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23133"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/23133\/revisions"}],"predecessor-version":[{"id":23134,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/23133\/revisions\/23134"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23133"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=23133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}