<?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 do I represent a time difference by changing the time format? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425342#M6620</link>
    <description>&lt;P&gt;@j_r, thats because TimeDiff is a string. &lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
 | search Process= my_process
 | dedup Job_Typ 
 | eval Difference=strptime(ende,"%H:%M:%S")-strptime(start,"%H:%M:%S")
 | eval Timediff=tostring(Difference,"duration")
 | chart values(Difference) over Process by  Timediff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 09 Dec 2018 00:42:40 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-12-09T00:42:40Z</dc:date>
    <item>
      <title>How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425339#M6617</link>
      <description>&lt;P&gt;hello all together,&lt;/P&gt;

&lt;P&gt;I'm new to Splunk and I have this problem:&lt;/P&gt;

&lt;P&gt;i want to represent a time difference and I already have the right search commands.&lt;/P&gt;

&lt;P&gt;Unfortunately, the formatting doesn't work yet.&lt;/P&gt;

&lt;P&gt;I want to display the difference in minutes. But, at the moment, 2 hours are added to the results (see picture).&lt;BR /&gt;
Example: The first line. The result in TimeDiff should be &lt;STRONG&gt;00&lt;/STRONG&gt;:10:35 and not &lt;STRONG&gt;02&lt;/STRONG&gt;:10:35.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6209i0C9CB853ABB62610/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 17:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425339#M6617</guid>
      <dc:creator>j_r</dc:creator>
      <dc:date>2018-12-06T17:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425340#M6618</link>
      <description>&lt;P&gt;@j_r,&lt;/P&gt;

&lt;P&gt;Timediff is calulated in seconds.&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval Timediff=tostring(strptime(ende,"%H:%M:%S")-strptime(start,"%H:%M:%S"),"duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Verified with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    |makeresults|eval start="10:13:48",ende="10:24:23"
    |eval Timediff=tostring(strptime(ende,"%H:%M:%S")-strptime(start,"%H:%M:%S"),"duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 18:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425340#M6618</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-06T18:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425341#M6619</link>
      <description>&lt;P&gt;Thanks @renjith.nair &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I would like to plot this time difference for a chosen process in a (time)chart. The Y-Axis should represent the time difference (Timediff) and the X-Axis the name of the Process.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
| search Process= my_process
| dedup Job_Typ 
| eval start = strptime(Startzeit, "%H:%M:%S")  
| eval ende = strptime(Endezeit, "%H:%M:%S")  
| eval Timediff=ende-start 
| eval start= strftime(start,"%H:%M:%S") 
| eval ende= strftime(ende,"%H:%M:%S") 
|eval Timediff=tostring(strptime(ende,"%H:%M:%S")-strptime(start,"%H:%M:%S"),"duration")
| table  start ende Timediff Process
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i tried with &lt;CODE&gt;| chart values(Timediff) by Process&lt;/CODE&gt; but the chart was empty.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 08:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425341#M6619</guid>
      <dc:creator>j_r</dc:creator>
      <dc:date>2018-12-07T08:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425342#M6620</link>
      <description>&lt;P&gt;@j_r, thats because TimeDiff is a string. &lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
 | search Process= my_process
 | dedup Job_Typ 
 | eval Difference=strptime(ende,"%H:%M:%S")-strptime(start,"%H:%M:%S")
 | eval Timediff=tostring(Difference,"duration")
 | chart values(Difference) over Process by  Timediff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Dec 2018 00:42:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425342#M6620</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-09T00:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425343#M6621</link>
      <description>&lt;P&gt;try this &lt;BR /&gt;
| stats sum(timediff) by process _time&lt;BR /&gt;
OR | chart values(timediff) over _time by process &lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 00:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425343#M6621</guid>
      <dc:creator>nagarjuna280</dc:creator>
      <dc:date>2018-12-09T00:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425344#M6622</link>
      <description>&lt;P&gt;Thanks for this, but unfortunately the result looks like this: &lt;IMG src="https://i.ibb.co/Vmm0jp7/Unbenannt.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;i changed the line to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart values(Difference) over _time by  Process
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And result is this one.&lt;BR /&gt;
&lt;IMG src="https://i.ibb.co/MV81yb2/Unbenannt.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Now the result is correct but how can i display the y axis as time (time format)?&lt;BR /&gt;
If i replace "Difference" by "Timediff" the chart ist empty&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 12:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425344#M6622</guid>
      <dc:creator>j_r</dc:creator>
      <dc:date>2018-12-10T12:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425345#M6623</link>
      <description>&lt;P&gt;The second one worked.  But the y axis is now as epoch time. How can i format it to "normal" time?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 12:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425345#M6623</guid>
      <dc:creator>j_r</dc:creator>
      <dc:date>2018-12-10T12:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I represent a time difference by changing the time format?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425346#M6624</link>
      <description>&lt;P&gt;add |convert ctime(_time)  at the end&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 03:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-represent-a-time-difference-by-changing-the-time-format/m-p/425346#M6624</guid>
      <dc:creator>nagarjuna280</dc:creator>
      <dc:date>2019-01-04T03:06:54Z</dc:date>
    </item>
  </channel>
</rss>

