<?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: ,number of days between two dates in same event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292619#M165733</link>
    <description>&lt;P&gt;No worries, glad you figured it out!!&lt;BR /&gt;
Please accept the answer if your problem is solved to award points and close the question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 12:53:52 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-10-10T12:53:52Z</dc:date>
    <item>
      <title>,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292609#M165723</link>
      <description>&lt;P&gt;In an event i have two dates. &lt;/P&gt;

&lt;P&gt;G_S="2017-10-07 23:21:19.0"  and  A_Z="2017-10-07 00:00:00.0"&lt;/P&gt;

&lt;P&gt;I have mutiple examples but somehow i cannot get it working. IK would like to know how to extract the number of days between these dates&lt;BR /&gt;&lt;BR /&gt;
 ,&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:08:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292609#M165723</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2020-09-29T16:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292610#M165724</link>
      <description>&lt;P&gt;Here's one way.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval eG_S=strptime(G_S,"%Y-%m-%d %H:%M:%S.%N"), eA_Z=strptime(A_Z, "%Y-%m-%d %H:%M:%S.%N") | eval days=(eG_S-eA_Z)/86400 | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292610#M165724</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-10-10T11:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292611#M165725</link>
      <description>&lt;P&gt;Thanks, but I have tried something like this before. I would expect a field as output with the number of days but i does not seem to work&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:55:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292611#M165725</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2017-10-10T11:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292612#M165726</link>
      <description>&lt;P&gt;if you used this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval days=floor((eG_S-eA_Z)/86400)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for the days you gave, it would give you 0 days, because it wasn't a full 24 hours. it'll automatically round down.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292612#M165726</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-10T12:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292613#M165727</link>
      <description>&lt;P&gt;I don't see an putputfield with a number of days, do I have to include this in my search?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:21:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292613#M165727</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2017-10-10T12:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292614#M165728</link>
      <description>&lt;P&gt;you'll need this whole string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval eG_S=strptime(G_S,"%Y-%m-%d %H:%M:%S.%N"), eA_Z=strptime(A_Z, "%Y-%m-%d %H:%M:%S.%N") | eval days=floor((eG_S-eA_Z)/86400)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;days should be a field as long as G_S and A_Z are the field names in your data. otherwise, replace them with the actual field names.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:13:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292614#M165728</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T16:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292615#M165729</link>
      <description>&lt;P&gt;I just made a change and now i see fields like eG_S and eA_Z. But the contents of these are like: 1507240800.000000 . &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292615#M165729</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2020-09-29T16:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292616#M165730</link>
      <description>&lt;P&gt;right. eG_S and eA_Z are in epoch (that is what strptime does), so that they can be used in calculations for the number of days. did you add the eval for days and does it work?&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/DateandTimeFunctions#strptime.28X.2CY.29" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/DateandTimeFunctions#strptime.28X.2CY.29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:13:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292616#M165730</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T16:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292617#M165731</link>
      <description>&lt;P&gt;I have used this whole string&lt;BR /&gt;
 | eval eG_S=strptime(G_S,"%Y-%m-%d %H:%M:%S.%N"), eA_Z=strptime(A_Z, "%Y-%m-%d %H:%M:%S.%N") &lt;BR /&gt;
| eval days=floor((eG_S-eA_Z)/86400)&lt;BR /&gt;
, the two fields eG_S and eA_Z are generated. But i dont see a result of number of days anywhere&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292617#M165731</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2020-09-29T16:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292618#M165732</link>
      <description>&lt;P&gt;sorry!!!, i did something wrong, i see the field 'days' now. Sorry wasting your time....&lt;BR /&gt;
Thans a lot for the help&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:40:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292618#M165732</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2017-10-10T12:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292619#M165733</link>
      <description>&lt;P&gt;No worries, glad you figured it out!!&lt;BR /&gt;
Please accept the answer if your problem is solved to award points and close the question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 12:53:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292619#M165733</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-10T12:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292620#M165734</link>
      <description>&lt;P&gt;If I want to use the current time in Splunk, can ik then just replace  G_S in NOW() ?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 06:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292620#M165734</guid>
      <dc:creator>Mike6960</dc:creator>
      <dc:date>2017-10-11T06:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: ,number of days between two dates in same event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292621#M165735</link>
      <description>&lt;P&gt;yes, that'll give you the current timestamp, and it's already in epoch, so there is no need to convert it. &lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:36:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/number-of-days-between-two-dates-in-same-event/m-p/292621#M165735</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-11T11:36:52Z</dc:date>
    </item>
  </channel>
</rss>

