<?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: X-Axis duration in hours, not seconds in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280070#M84557</link>
    <description>&lt;P&gt;Thanks. I ended up using this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pan_logs eventtype=pan_system log_subtype=globalprotect sourcetype=pan:system 
| transaction pan_gp_user startswith="globalprotectgateway-auth-succ" endswith="globalprotectgateway-logout-succ"
| where duration&amp;gt;0
| eval event_duration=tostring(duration,"duration")
| chart values(duration) over pan_gp_user by event_duration
| addtotals
| sort -Total
| fields - Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Events did stack up together, but X-Axis is still in seconds&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2016 21:48:31 GMT</pubDate>
    <dc:creator>pashtet13</dc:creator>
    <dc:date>2016-07-25T21:48:31Z</dc:date>
    <item>
      <title>X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280064#M84551</link>
      <description>&lt;P&gt;I am using the following search to get a total VPN connection time for users:&lt;/P&gt;

&lt;P&gt;index=pan_logs eventtype=pan_system log_subtype=globalprotect sourcetype=pan:system&lt;BR /&gt;
| transaction pan_gp_user startswith="globalprotectgateway-auth-succ" endswith="globalprotectgateway-logout-succ" &lt;BR /&gt;
| stats sum(duration) by pan_gp_user&lt;BR /&gt;
| sort by -sum(duration)&lt;/P&gt;

&lt;P&gt;I am using Bar Chart and X-Axis is showing duration in seconds. Converting to hh:mm:ss format worked in a regular search, but not for Bar Chart. Any way I can make X-Axis to show time in readable format (hh:mm:ss), rather than in seconds?&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/150228-1.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280064#M84551</guid>
      <dc:creator>pashtet13</dc:creator>
      <dc:date>2020-09-29T10:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280065#M84552</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pan_logs eventtype=pan_system log_subtype=globalprotect sourcetype=pan:system
| transaction pan_gp_user startswith="globalprotectgateway-auth-succ" endswith="globalprotectgateway-logout-succ" 
| stats sum(duration) AS duration BY pan_gp_user
| sort by -duration | fieldformat duration=tostring(duration, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jul 2016 15:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280065#M84552</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-25T15:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280066#M84553</link>
      <description>&lt;P&gt;I don't believe you can change the format of x-axis for a bar chart t a string value, just like you cannot change the format of y-axis on a column chart. &lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 16:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280066#M84553</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-25T16:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280067#M84554</link>
      <description>&lt;P&gt;That is the beauty of &lt;CODE&gt;fieldformat&lt;/CODE&gt;; it does not change the value.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 16:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280067#M84554</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-25T16:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280068#M84555</link>
      <description>&lt;P&gt;Thanks. I already tried &lt;EM&gt;fieldformat&lt;/EM&gt; before asking this question. It does not change the chart at all&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 19:53:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280068#M84555</guid>
      <dc:creator>pashtet13</dc:creator>
      <dc:date>2016-07-25T19:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280069#M84556</link>
      <description>&lt;P&gt;In bar chart, the x-axis shows the series values and it has to be numeric in order to be plotted as chart. Converting to hh:mm will make it as string and it will not work. For your case try this workaround (runanywhere sample)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | gentimes start=-1 | eval temp="user1#2000 user2#1400 user3#1100 user4#1700" | table temp | makemv temp | mvexpand temp | rex field=temp "(?&amp;lt;user&amp;gt;\w+)#(?&amp;lt;series&amp;gt;\d+)" | table user series 
| eval duration=tostring(series,"duration") | chart values(series) over user by duration | addtotals | sort -Total | fields - Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Replace first 2 lines with  your current search and use stacked option in the bar chart visualization.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 21:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280069#M84556</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-25T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280070#M84557</link>
      <description>&lt;P&gt;Thanks. I ended up using this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pan_logs eventtype=pan_system log_subtype=globalprotect sourcetype=pan:system 
| transaction pan_gp_user startswith="globalprotectgateway-auth-succ" endswith="globalprotectgateway-logout-succ"
| where duration&amp;gt;0
| eval event_duration=tostring(duration,"duration")
| chart values(duration) over pan_gp_user by event_duration
| addtotals
| sort -Total
| fields - Total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Events did stack up together, but X-Axis is still in seconds&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 21:48:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280070#M84557</guid>
      <dc:creator>pashtet13</dc:creator>
      <dc:date>2016-07-25T21:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: X-Axis duration in hours, not seconds</title>
      <link>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280071#M84558</link>
      <description>&lt;P&gt;You are right; I should have tested.  I think that it is impossible with native dashboarding facilities.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 14:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/X-Axis-duration-in-hours-not-seconds/m-p/280071#M84558</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-27T14:30:15Z</dc:date>
    </item>
  </channel>
</rss>

