{"id":50188,"date":"2022-01-18T17:42:47","date_gmt":"2022-01-18T17:42:47","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=50188"},"modified":"2022-01-18T17:42:47","modified_gmt":"2022-01-18T17:42:47","slug":"answer-by-warren-for-splunk-how-to-get-a-timechart-regarding-the-extracted-_time-values-for-which-range-was-applied","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=50188","title":{"rendered":"Answer by warren for Splunk: How to get a timechart regarding the extracted _time values for which range() was applied?"},"content":{"rendered":"<p><a href=\"https:\/\/docs.splunk.com\/Documentation\/Splunk\/latest\/SearchReference\/timechart\" rel=\"nofollow noreferrer\"><code>timechart<\/code><\/a> requires the hidden field <code>_time<\/code> still exist &#8211; in this example, there is no <code>_time<\/code> field<\/p>\n<p>So you&#8217;re going to need to <a href=\"https:\/\/antipaucity.com\/2020\/08\/18\/how-to-timechart-possibly-better-than-timechart-in-splunk\/#.Yeb43SxOlAc\" rel=\"nofollow noreferrer\">&quot;fake&quot; your timechart<\/a> &#8211; or you&#8217;re going to need to get <code>_time<\/code> back somehow or other<\/p>\n<p>Something along these lines should work:<\/p>\n<pre><code>index=ndx (&quot;Request&quot; OR &quot;Response&quot;)\n| rex field=_raw &quot;id\\&quot;:\\&quot;(?&lt;id&gt;[a-z0-9-]+)&quot; \n| stats min(_time) as Requesttime, max(_time) as Responsetime, range(_time) as diff by id date_minute\n| stats avg(diff) as avg by id date_minute\n<\/code><\/pre>\n<p>(I took out the extraneous first <code>| table<\/code> line, as it slows the search down, and <code>| stats<\/code> will yield a table when it&#8217;s completed)<\/p>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/70753282\/splunk-how-to-get-a-timechart-regarding-the-extracted-time-values-for-which-ra\/70760078#70760078<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>timechart requires the hidden field _time still exist &#8211; in this example, there is no _time field So you&#8217;re going to need to &quot;fake&quot; your timechart &#8211; or you&#8217;re going to need to get _time back somehow or other Something along these lines should work: index=ndx (&quot;Request&quot; OR &quot;Response&quot;) | rex field=_raw &quot;id\\&quot;:\\&quot;(?&lt;id&gt;[a-z0-9-]+)&quot; | stats &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=50188\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for Splunk: How to get a timechart regarding the extracted _time values for which range() was applied?<\/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-50188","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\/50188","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=50188"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/50188\/revisions"}],"predecessor-version":[{"id":50189,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/50188\/revisions\/50189"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=50188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=50188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=50188"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=50188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}