<?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: Calculate time interval between 2 timestamps records in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235540#M585</link>
    <description>&lt;P&gt;I will try to test with your dataset&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 15:10:13 GMT</pubDate>
    <dc:creator>gbaudart</dc:creator>
    <dc:date>2024-01-25T15:10:13Z</dc:date>
    <item>
      <title>Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235476#M573</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_0-1706177661722.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17186i14DEF6E0F361B8DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_0-1706177661722.png" alt="AlexisGND_0-1706177661722.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi, I ingested customized logs into Dynatrace.&lt;/P&gt;&lt;P&gt;I have 2 columns named "bmx.hip.execution.endtime" and&amp;nbsp;"bmx.hip.execution.starttime" with are timestamps in iso format.&lt;/P&gt;&lt;P&gt;Is there any way to calculate the time interval between the two of them in a separate column that I created "timediff" ?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 10:22:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235476#M573</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T10:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235477#M574</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/68059"&gt;@AlexisGND&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you may try this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldsAdd timeDiff = endtime - startime
| fields timeDiff&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 10:26:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235477#M574</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T10:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235486#M575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/64996"&gt;@gbaudart&lt;/a&gt;,&amp;nbsp;thanks for your reply.&lt;/P&gt;&lt;P&gt;I tried this DQL command :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_2-1706179239363.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17189i3F476FA539BD19BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_2-1706179239363.png" alt="AlexisGND_2-1706179239363.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just changed the name of the column in english (and not in french).&lt;/P&gt;&lt;P&gt;But "timeDiff" is still on "null", does that means that timeDiff is not able to calculate time interval with 2 iso formats ?&lt;/P&gt;&lt;P&gt;Result :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_1-1706179220337.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17188iCE0B8BB0E53AB1E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_1-1706179220337.png" alt="AlexisGND_1-1706179220337.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If it's not possible to calculate the time interval, i tried an alternative way (only if the DQL above is not the solution)&lt;/STRONG&gt; :&lt;/P&gt;&lt;P&gt;(i tried an alernative way to do substings with the timestamp in order to get and associates numbers with Year, month etc)&lt;BR /&gt;It's done like this :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_4-1706179692560.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17191i3DD5FCFD9B8A6659/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_4-1706179692560.png" alt="AlexisGND_4-1706179692560.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But i get an error that shows it's not possible to calculate between numbers (or i don't understand the error message).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_3-1706179656623.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17190i1C538B6BB07E2565/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_3-1706179656623.png" alt="AlexisGND_3-1706179656623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 10:50:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235486#M575</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T10:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235490#M576</link>
      <description>&lt;P&gt;I'm doing exactly the same thing in my environment with the DQL request I sent.&lt;BR /&gt;There must be something to fix.&lt;BR /&gt;I'll think about it.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 12:12:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235490#M576</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T12:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235491#M577</link>
      <description>&lt;P&gt;Try this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldsAdd StartTimeModif = formatTimestamp(StartTime,format:"dd MMM YYYY HH:mm:ss"), EndTimeModif = formatTimestamp(EndTime,format:"dd MMM YYYY HH:mm:ss"), DiffTime = EndTimeModif - StartTimeModif
| fields DiffTime&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Jan 2024 12:21:29 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235491#M577</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T12:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235504#M578</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_0-1706186151819.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17195iBA2E2772E5C1D361/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_0-1706186151819.png" alt="AlexisGND_0-1706186151819.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;DiffTime is still on "null"&lt;BR /&gt;Even if i change to End_execution and Start_execution&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_1-1706186193419.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17196iE9EEA3AF95014A67/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_1-1706186193419.png" alt="AlexisGND_1-1706186193419.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even when i display everything, I have null on StartTime and EndTime :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_2-1706187082909.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17198iB79E2D5E34A110A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_2-1706187082909.png" alt="AlexisGND_2-1706187082909.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am currently looking at the time functions documentation&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/time-functions#duration" target="_blank"&gt;Time functions - Dynatrace Docs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I will let you know if i find anything&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 12:51:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235504#M578</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T12:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235507#M579</link>
      <description>&lt;P&gt;your variable aren't good.&lt;/P&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldsAdd StartTimeModif = formatTimestamp(Start_execution,format:"dd MMM YYYY HH:mm:ss"), EndTimeModif = formatTimestamp(End_execution,format:"dd MMM YYYY HH:mm:ss"), DiffTime = EndTimeModif - StartTimeModif
| fields DiffTime&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 13:11:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235507#M579</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T13:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235513#M580</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_0-1706189110413.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17200i5D82AE4DA90E7432/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_0-1706189110413.png" alt="AlexisGND_0-1706189110413.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I changed the time format because I saw in the line :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;format:"dd MMM YYYY HH:mm:ss"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Now Start and End have time but DiffTime has nothing&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 13:30:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235513#M580</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T13:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235520#M581</link>
      <description>&lt;P&gt;May you paste your entire query pls ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 13:52:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235520#M581</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T13:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235534#M582</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_0-1706192175103.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17214i04713600442C0CA5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_0-1706192175103.png" alt="AlexisGND_0-1706192175103.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;// get logs&lt;BR /&gt;fetch logs&lt;BR /&gt;// filter timestamp descending&lt;BR /&gt;| sort timestamp desc&lt;BR /&gt;&lt;BR /&gt;// rename columns&lt;BR /&gt;| fieldsRename End_execution = bmx.hip.execution.endtime&lt;BR /&gt;| fieldsRename Start_execution = bmx.hip.execution.starttime&lt;BR /&gt;| fieldsRename HostName = bmx.hip.host.name&lt;BR /&gt;&lt;BR /&gt;// filter host names with Datastage&lt;BR /&gt;| filter HostName == "Datastage" or HostName == "DATASTAGE" or HostName == "datastage"&lt;BR /&gt;&lt;BR /&gt;// display columns&lt;BR /&gt;| fieldsAdd StartTimeModif = formatTimestamp(Start_execution,format:"dd MMM YYYY HH:mm:ss"), EndTimeModif = formatTimestamp(End_execution,format:"dd MMM YYYY HH:mm:ss"), DiffTime = EndTimeModif - StartTimeModif&lt;BR /&gt;| fields DiffTime, Start_execution, StartTimeModif, End_execution, EndTimeModif&lt;/PRE&gt;&lt;P&gt;the "formatted" field was just a test.&lt;BR /&gt;But my guess is the incorrect format of Start_execution and End_execution&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 14:20:23 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235534#M582</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T14:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235538#M584</link>
      <description>&lt;P&gt;By doing a test, when I do "formatTimestamp", the default timestamp is correct but even when the Endtime is with the same format as the timestamp, still got a null.&lt;BR /&gt;I really don't get it... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_0-1706194067044.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17215i5D197EC3A0351263/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_0-1706194067044.png" alt="AlexisGND_0-1706194067044.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;fetch logs&lt;BR /&gt;| sort timestamp desc&lt;BR /&gt;| filter bmx.hip.host.name == "Datastage"&lt;BR /&gt;&lt;BR /&gt;| fieldsAdd formatted = formatTimestamp(timestamp, format:"MM-dd-YYYY")&lt;BR /&gt;| fieldsAdd formatted2 = formatTimestamp(bmx.hip.execution.endtime, format:"MM-dd-YYYY")&lt;BR /&gt;&lt;BR /&gt;| fields timestamp, formatted, bmx.hip.execution.endtime, formatted2&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 14:48:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235538#M584</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T14:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235540#M585</link>
      <description>&lt;P&gt;I will try to test with your dataset&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:10:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235540#M585</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T15:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235542#M586</link>
      <description>&lt;P&gt;I suspect that ingested fields are just Strings. To do any arithmetics they need to be converted to timestamps. &lt;EM&gt;&lt;STRONG&gt;toTimestamp&lt;/STRONG&gt; &lt;/EM&gt;function should catch iso format. Please try query based on this example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(ts="2024-01-22 15:30:01.000000", te="2024-01-22 15:30:01.500000")
| fieldsAdd pts=toTimestamp(ts), pte=toTimestamp(te)
| fieldsAdd d=pte-pts&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1706195439880.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17216iA4CEF43AA06183A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="krzysztof_hoja_0-1706195439880.png" alt="krzysztof_hoja_0-1706195439880.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:12:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235542#M586</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-01-25T15:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235547#M587</link>
      <description>&lt;P&gt;So I finally arrived at the end result &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;What I did ?&lt;/STRONG&gt;&lt;BR /&gt;The start time (as bmx.hip.execution.starttime) and end time (as bmx.hip.execution.endtime) were converted to timestamp formats with this lines :&lt;/P&gt;&lt;PRE&gt;// convert start and end times to timestamp format&lt;BR /&gt;| fieldsAdd bmx.hip.execution.endtime = toTimestamp(bmx.hip.execution.endtime),&lt;BR /&gt;bmx.hip.execution.starttime = toTimestamp(bmx.hip.execution.starttime)&lt;/PRE&gt;&lt;P&gt;And then I added a new field to substract the endtime with the starttime.&lt;/P&gt;&lt;PRE&gt;| fieldsAdd bmx.hip.execution.duration = bmx.hip.execution.endtime - bmx.hip.execution.starttime&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Final dql :&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;// get logs&lt;BR /&gt;fetch logs&lt;BR /&gt;// filter timestamp descending&lt;BR /&gt;| sort timestamp desc&lt;BR /&gt;&lt;BR /&gt;// filter host names with Datastage&lt;BR /&gt;| filter bmx.hip.host.name == "Datastage" or bmx.hip.host.name == "DATASTAGE" or bmx.hip.host.name == "datastage"&lt;BR /&gt;| filter loglevel == "NOTICE" or loglevel == "NONE" or loglevel == "DEBUG"&lt;BR /&gt;&lt;BR /&gt;// convert start and end times to timestamp format&lt;BR /&gt;| fieldsAdd bmx.hip.execution.endtime = toTimestamp(bmx.hip.execution.endtime),&lt;BR /&gt;bmx.hip.execution.starttime = toTimestamp(bmx.hip.execution.starttime)&lt;BR /&gt;| fieldsAdd bmx.hip.execution.duration = bmx.hip.execution.endtime - bmx.hip.execution.starttime&lt;BR /&gt;&lt;BR /&gt;// display columns&lt;BR /&gt;| fields content, bmx.hip.execution.starttime, bmx.hip.execution.endtime, bmx.hip.execution.duration, bmx.hip.execution.status&lt;BR /&gt;&lt;BR /&gt;// rename columns&lt;BR /&gt;| fieldsRename End_execution = bmx.hip.execution.endtime&lt;BR /&gt;| fieldsRename Start_execution = bmx.hip.execution.starttime&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Final visual result :&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlexisGND_0-1706197019925.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17218i7F07FCBF653D3049/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlexisGND_0-1706197019925.png" alt="AlexisGND_0-1706197019925.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/64996"&gt;@gbaudart&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/25373"&gt;@krzysztof_hoja&lt;/a&gt;&amp;nbsp;for your help !&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:51:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235547#M587</guid>
      <dc:creator>AlexisGND</dc:creator>
      <dc:date>2024-01-25T15:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate time interval between 2 timestamps records</title>
      <link>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235549#M588</link>
      <description>&lt;P&gt;If you just try this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch logs
| sort timestamp desc
| filter bmx.hip.host.name == "Datastage"

| fields toTimestamp(bmx.hip.execution.endtime), toTimestamp(bmx.hip.execution.starttime)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you also get "null" for the 2 results?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:45:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Calculate-time-interval-between-2-timestamps-records/m-p/235549#M588</guid>
      <dc:creator>gbaudart</dc:creator>
      <dc:date>2024-01-25T15:45:58Z</dc:date>
    </item>
  </channel>
</rss>

