<?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 you build a chart from two date fields? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440009#M76736</link>
    <description>&lt;P&gt;You almost had it.  Once you subtract the respective epoch times you just need to put the result back into text form.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval InspectionDate=strftime(strptime(CompletionDate, “%Y-%m-%dT%H:%M:%S”)-strptime(CommencementDate, “%Y-%m-%dT%H:%M:%S”), "%Y-%m-%dT%H:%M:%S") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Oct 2018 12:55:28 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-10-22T12:55:28Z</dc:date>
    <item>
      <title>How do you build a chart from two date fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440008#M76735</link>
      <description>&lt;P&gt;On my current data I have two date fields: &lt;STRONG&gt;CommencementDate&lt;/STRONG&gt; and &lt;STRONG&gt;CompletitionDate&lt;/STRONG&gt;.&lt;BR /&gt;
I would like to build a chart where the timestamp would be CompletitionDate - CommencementDate. For that, I created the query below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval InspectionDate=strptime(CompletionDate, “%Y-%m-%dT%H:%M:%S”)-strptime(CommencementDate, “%Y-%m-%dT%H:%M:%S”) |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The date format is: 2015-01-27T06:00:00&lt;/P&gt;

&lt;P&gt;Could someone please advise?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 11:37:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440008#M76735</guid>
      <dc:creator>gcescatto</dc:creator>
      <dc:date>2018-10-22T11:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you build a chart from two date fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440009#M76736</link>
      <description>&lt;P&gt;You almost had it.  Once you subtract the respective epoch times you just need to put the result back into text form.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval InspectionDate=strftime(strptime(CompletionDate, “%Y-%m-%dT%H:%M:%S”)-strptime(CommencementDate, “%Y-%m-%dT%H:%M:%S”), "%Y-%m-%dT%H:%M:%S") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 12:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440009#M76736</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-10-22T12:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you build a chart from two date fields?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440010#M76737</link>
      <description>&lt;P&gt;Hi richgalloway (:&lt;/P&gt;

&lt;P&gt;I did try using the updated query you provided me, but I’m still not getting any results for InspectionTime... any other inputs? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 16:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-build-a-chart-from-two-date-fields/m-p/440010#M76737</guid>
      <dc:creator>gcescatto</dc:creator>
      <dc:date>2018-10-22T16:53:23Z</dc:date>
    </item>
  </channel>
</rss>

