<?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 plot duration on y-axis? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143718#M39941</link>
    <description>&lt;P&gt;Yup.  &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/25502"&gt;@Flynt&lt;/a&gt;'s suggestion is working for me.  You rock, dude &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;
I did remove the first table command just to tidy up things a bit:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
yoursearch |dedup date_mday| rex field=Duration "(?^.+):(?.+):(?.+$)"|eval hour=hour*60*60|eval min=min*60|eval Duration=round(((hour+min+sec)/60),2)|table date_mday, Duration|sort + date_mday&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:32:04 GMT</pubDate>
    <dc:creator>splunkIT</dc:creator>
    <dc:date>2020-09-28T19:32:04Z</dc:date>
    <item>
      <title>How to plot duration on y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143716#M39939</link>
      <description>&lt;P&gt;I have a simple search like this:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
index=main sourcetype=test | table date_mday, Duration&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
Note: the values for Duration are in time format (hh:mm:ss)&lt;/P&gt;

&lt;P&gt;When I create a line chart, nothing appears on the chart.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 19:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143716#M39939</guid>
      <dc:creator>splunkIT</dc:creator>
      <dc:date>2015-04-14T19:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot duration on y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143717#M39940</link>
      <description>&lt;P&gt;Duration is a string so this would have to be converted in order to plot correctly.&lt;/P&gt;

&lt;P&gt;One way to do this is convert the duration to seconds and then plot from there. For instance if your results return a Duration field (along with date_mday)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch |dedup date_mday| table Duration, date_mday|rex field=Duration "(?&amp;lt;hour&amp;gt;^.+):(?&amp;lt;min&amp;gt;.+):(?&amp;lt;sec&amp;gt;.+$)"|eval hour=hour*60*60|eval min=min*60|eval Duration=round(((hour+min+sec)/60),2)|table date_mday, Duration|sort + date_mday
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should chart the Duration in minutes (that's where our /60 in the last eval statement comes in) on the y axis over the date_mday on the x axis&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 19:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143717#M39940</guid>
      <dc:creator>Flynt</dc:creator>
      <dc:date>2015-04-14T19:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot duration on y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143718#M39941</link>
      <description>&lt;P&gt;Yup.  &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/25502"&gt;@Flynt&lt;/a&gt;'s suggestion is working for me.  You rock, dude &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;
I did remove the first table command just to tidy up things a bit:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
yoursearch |dedup date_mday| rex field=Duration "(?^.+):(?.+):(?.+$)"|eval hour=hour*60*60|eval min=min*60|eval Duration=round(((hour+min+sec)/60),2)|table date_mday, Duration|sort + date_mday&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143718#M39941</guid>
      <dc:creator>splunkIT</dc:creator>
      <dc:date>2020-09-28T19:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot duration on y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143719#M39942</link>
      <description>&lt;P&gt;Err. You could also do it simply with Convert- Sorry didn't think about this one until I looked at all those evals. dur2sec will also take into account days if they exist in the Duration field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch |dedup date_mday|convert dur2sec(Duration) |table date_mday, Duration|eval Duration=round(((Duration)/60),2)|sort + date_mday
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Apr 2015 19:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143719#M39942</guid>
      <dc:creator>Flynt</dc:creator>
      <dc:date>2015-04-14T19:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot duration on y-axis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143720#M39943</link>
      <description>&lt;P&gt;My second answer is actually cleaner and more effective.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 20:02:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-plot-duration-on-y-axis/m-p/143720#M39943</guid>
      <dc:creator>Flynt</dc:creator>
      <dc:date>2015-04-14T20:02:47Z</dc:date>
    </item>
  </channel>
</rss>

