<?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 to compare when a field value changes from current to previous? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491875#M137272</link>
    <description>&lt;P&gt;Wow that is awesome!!! Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2020 20:30:45 GMT</pubDate>
    <dc:creator>Glasses</dc:creator>
    <dc:date>2020-05-06T20:30:45Z</dc:date>
    <item>
      <title>How to compare when a field value changes from current to previous?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491873#M137270</link>
      <description>&lt;P&gt;I am looking to find events where  IP address changes  from previous to current, however using fist(ip) and last(ip) misses the events in between the first and last...   &lt;/P&gt;

&lt;P&gt;Ideally I am looking to find when a change occurs for the IP value and then look at the previous IP value... this comparison is then used to find ip geoloc and calc the speed = dist/time  with haversine app.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 18:45:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491873#M137270</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-05-06T18:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare when a field value changes from current to previous?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491874#M137271</link>
      <description>&lt;P&gt;Look at the &lt;CODE&gt;streamstats&lt;/CODE&gt; command for this. Any tracking of change over time, &lt;CODE&gt;streamstats&lt;/CODE&gt; is your go-to verb. &lt;/P&gt;

&lt;P&gt;We'll assume there is a key called &lt;CODE&gt;user&lt;/CODE&gt;.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search that gets the records you want, with at least these fields  
| fields _time user someIP
| sort 0 _time 
| streamstats current=f last(someIP) as priorIP last(_time) as priorTime  by user
| where NOT (someIP=priorIP)
 ... the remainder of your search. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 19:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491874#M137271</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-05-06T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare when a field value changes from current to previous?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491875#M137272</link>
      <description>&lt;P&gt;Wow that is awesome!!! Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 20:30:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491875#M137272</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-05-06T20:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare when a field value changes from current to previous?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491876#M137273</link>
      <description>&lt;P&gt;You are quite welcome.  &lt;CODE&gt;streamstats&lt;/CODE&gt; processes the records in order, remembering only the records it has already seen, so you must sort the records in the order you want before you apply the command. &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 20:44:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491876#M137273</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-05-06T20:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare when a field value changes from current to previous?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491877#M137274</link>
      <description>&lt;P&gt;so that is the purpose of sort 0 &amp;gt; return all results, thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 20:48:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-when-a-field-value-changes-from-current-to/m-p/491877#M137274</guid>
      <dc:creator>Glasses</dc:creator>
      <dc:date>2020-05-06T20:48:01Z</dc:date>
    </item>
  </channel>
</rss>

