<?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 How to compare same date field after status changes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365016#M162965</link>
    <description>&lt;P&gt;I'm trying to compare the same date field between two different events.&lt;/P&gt;

&lt;P&gt;An event has the following fields that are important for the comparison. &lt;/P&gt;

&lt;P&gt;DATE&lt;BR /&gt;
STATE&lt;BR /&gt;
ID&lt;/P&gt;

&lt;P&gt;For example: ID 12345 receives on 5-2-2018 the STATE 'New' &lt;BR /&gt;
The same ID receives on 13-2-2018 the STATE 'Executed'&lt;/P&gt;

&lt;P&gt;Sow what I'm looking for is a statement that compares the different STATE for each unique ID.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2018 14:05:12 GMT</pubDate>
    <dc:creator>ebruozys</dc:creator>
    <dc:date>2018-02-12T14:05:12Z</dc:date>
    <item>
      <title>How to compare same date field after status changes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365016#M162965</link>
      <description>&lt;P&gt;I'm trying to compare the same date field between two different events.&lt;/P&gt;

&lt;P&gt;An event has the following fields that are important for the comparison. &lt;/P&gt;

&lt;P&gt;DATE&lt;BR /&gt;
STATE&lt;BR /&gt;
ID&lt;/P&gt;

&lt;P&gt;For example: ID 12345 receives on 5-2-2018 the STATE 'New' &lt;BR /&gt;
The same ID receives on 13-2-2018 the STATE 'Executed'&lt;/P&gt;

&lt;P&gt;Sow what I'm looking for is a statement that compares the different STATE for each unique ID.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 14:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365016#M162965</guid>
      <dc:creator>ebruozys</dc:creator>
      <dc:date>2018-02-12T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same date field after status changes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365017#M162966</link>
      <description>&lt;P&gt;have you tried stats command :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;base search&amp;gt;|stats values(STATE) by DATE ID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it will return all values of STATE by ID and DATE&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 14:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365017#M162966</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-12T14:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same date field after status changes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365018#M162967</link>
      <description>&lt;P&gt;I see my initial question wasn't complete. &lt;/P&gt;

&lt;P&gt;I'm trying to create a list that shows how long it took for each unique ID to get from STATE 'New' to STATE 'Executed'&lt;/P&gt;

&lt;P&gt;I know how to compare two different date fields, but I have never compaired the same date field that has a different STATE.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 14:23:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365018#M162967</guid>
      <dc:creator>ebruozys</dc:creator>
      <dc:date>2018-02-12T14:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same date field after status changes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365019#M162968</link>
      <description>&lt;P&gt;Usually when I try to compare dates I tend to convert them to a number, do the math, and reformat them in dates. You can use &lt;CODE&gt;strptime&lt;/CODE&gt; (&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/DateandTimeFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/DateandTimeFunctions&lt;/A&gt;) that will take your date as input and return you an epoch that you can easily compare since it's a number. Combine that with &lt;CODE&gt;streamstats&lt;/CODE&gt; or &lt;CODE&gt;eventstats&lt;/CODE&gt; to get the result you want.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 14:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365019#M162968</guid>
      <dc:creator>isabel_ycourbe</dc:creator>
      <dc:date>2018-02-12T14:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same date field after status changes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365020#M162969</link>
      <description>&lt;P&gt;I ended up using Transaction command&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;base search&amp;gt;| transaction ID startswith=eval(STATE="New") endswith=eval(STATE="Executed") | table ID STATE duration&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 13:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365020#M162969</guid>
      <dc:creator>ebruozys</dc:creator>
      <dc:date>2018-02-13T13:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare same date field after status changes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365021#M162970</link>
      <description>&lt;P&gt;Elegant solution.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 13:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-same-date-field-after-status-changes/m-p/365021#M162970</guid>
      <dc:creator>isabel_ycourbe</dc:creator>
      <dc:date>2018-02-13T13:55:54Z</dc:date>
    </item>
  </channel>
</rss>

