{"id":51066,"date":"2022-02-03T13:57:30","date_gmt":"2022-02-03T13:57:30","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=51066"},"modified":"2022-02-03T13:57:30","modified_gmt":"2022-02-03T13:57:30","slug":"answer-by-warren-for-splunk-search-with-starttime-and-endtime-with-format-ymd-hms","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=51066","title":{"rendered":"Answer by warren for Splunk: search with starttime and endtime with format &#8220;%Y%m%d %H:%M:%S&#8221;"},"content":{"rendered":"<p>You have to convert your human-readable timestamp to Unix epoch time &#8211; since <code>_time<\/code> is <em>always<\/em> <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/DateandTimeFunctions\" rel=\"nofollow noreferrer\">in Unix epoch time<\/a><\/p>\n<p>Check out strftime.org for the exact calls<\/p>\n<p>Then you can send this in your <code>curl<\/code> call:<\/p>\n<pre><code>curl -u &quot;$user:$pass&quot; -k https:\/\/$splunkserver\/services\/search\/jobs\/export -d search='search &quot;'&quot;$search&quot;'&quot; | search index=$index sourcetype=$sourcetype' earliest=$STARTTIME latest=$ENDTIME'\n<\/code><\/pre>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/70971811\/splunk-search-with-starttime-and-endtime-with-format-ymd-hms\/70972529#70972529<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You have to convert your human-readable timestamp to Unix epoch time &#8211; since _time is always in Unix epoch time Check out strftime.org for the exact calls Then you can send this in your curl call: curl -u &quot;$user:$pass&quot; -k https:\/\/$splunkserver\/services\/search\/jobs\/export -d search=&#8217;search &quot;&#8217;&quot;$search&quot;&#8217;&quot; | search index=$index sourcetype=$sourcetype&#8217; earliest=$STARTTIME latest=$ENDTIME&#8217; from User warren &#8211; Stack &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=51066\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Splunk: search with starttime and endtime with format &#8220;%Y%m%d %H:%M:%S&#8221;<\/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-51066","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\/51066","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=51066"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/51066\/revisions"}],"predecessor-version":[{"id":51067,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/51066\/revisions\/51067"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51066"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=51066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}