{"id":41226,"date":"2021-08-13T13:08:17","date_gmt":"2021-08-13T13:08:17","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=41226"},"modified":"2021-08-13T13:08:17","modified_gmt":"2021-08-13T13:08:17","slug":"answer-by-warren-for-splunk-panel-showing-graph-for-a-specific-time-range","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=41226","title":{"rendered":"Answer by warren for Splunk panel showing graph for a specific time range"},"content":{"rendered":"<p>Something like this should work (so long as you have the <a href=\"https:\/\/antipaucity.com\/2020\/08\/18\/how-to-timechart-possibly-better-than-timechart-in-splunk\/#.YRZp4-0pBAd\" rel=\"nofollow noreferrer\">automatic<\/a> field <code>date_hour<\/code> created by Splunk):<\/p>\n<pre><code>index=&quot;index_a&quot; sourcetype=&quot;pqr&quot; source=&quot;prq_source&quot; &quot;Success in api response&quot; earliest=-7d\n| where (date_hour&gt;=21 AND date_minute&gt;=30) OR date_hour&gt;=22\n| stats avg(call_duration) as avg_call by success_id\n<\/code><\/pre>\n<p>If <code>date_hour<\/code> &amp; date_minute <em>aren&#8217;t<\/em> being automatically supplied by Splunk, you can create them yourself with <a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/DateandTimeFunctions#strftime.28X.2CY.29\" rel=\"nofollow noreferrer\"><code>strftime<\/code><\/a>:<\/p>\n<pre><code>| eval date_hour=strftime(_time,&quot;%H&quot;), date_minute=strftime(_time,&quot;%M&quot;)\n<\/code><\/pre>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/68765482\/splunk-panel-showing-graph-for-a-specific-time-range\/68772685#68772685<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Something like this should work (so long as you have the automatic field date_hour created by Splunk): index=&quot;index_a&quot; sourcetype=&quot;pqr&quot; source=&quot;prq_source&quot; &quot;Success in api response&quot; earliest=-7d | where (date_hour&gt;=21 AND date_minute&gt;=30) OR date_hour&gt;=22 | stats avg(call_duration) as avg_call by success_id If date_hour &amp; date_minute aren&#8217;t being automatically supplied by Splunk, you can create them yourself with &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=41226\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Splunk panel showing graph for a specific time range<\/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-41226","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\/41226","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=41226"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/41226\/revisions"}],"predecessor-version":[{"id":41227,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/41226\/revisions\/41227"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=41226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=41226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=41226"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=41226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}