<?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: Compare two different values from two different periods in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545262#M154417</link>
    <description>&lt;P&gt;Why don't you just set your initial search to capture the two periods of data like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=oms sourcetype="oms-dashboard" logType="transaction" stage="end" earliest=-1450m latest=-1440m) OR
(index=oms sourcetype="oms-dashboard" logType="transaction" stage="end" earliest=-10m latest=now)
| eval period=if(_time&amp;gt;=relative_time(now(),"-23h"),"current","previous")
| chart count(request) over request by period
| eval difference=abs(previous-current)/previous*100
| table request difference previous current&lt;/LI-CODE&gt;&lt;P&gt;The rest of your search is fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Mar 2021 06:16:31 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-03-25T06:16:31Z</dc:date>
    <item>
      <title>Compare two different values from two different periods</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545230#M154408</link>
      <description>&lt;P&gt;I saw a few examples&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-search-results-from-two-different-time-periods/m-p/221177" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/How-do-I-compare-search-results-from-two-different-time-periods/m-p/221177&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-time-same-time-frames-with-different-day-s/m-p/504217" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-time-same-time-frames-with-different-day-s/m-p/504217&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But these queries arent exact doing what I want to do. I basically want to do a 10min interval from now to 10 minutes ago. And compare it against the value from -24h and -24h (and 10 minutes before that) to do a comparison between the values. Whether it is in day to day trend for that 10min period&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=oms sourcetype="oms-dashboard" logType="transaction" stage="end" earliest=-24h latest=-1h
| eval period=if(_time&amp;gt;=relative_time(now(),"-23h"),"current","previous")  | chart count(request) over request by period  | eval difference=abs(previous-current)/previous*100 | table request difference previous current
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone has an idea?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 22:59:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545230#M154408</guid>
      <dc:creator>exocore123</dc:creator>
      <dc:date>2021-03-24T22:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two different values from two different periods</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545235#M154411</link>
      <description>&lt;P&gt;Actually I think I solved it&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=oms sourcetype="oms-prod" logType="transaction" stage="end" earliest=-2h latest=-1h | stats count AS previous by request | appendcols [search index=ecp-ord-oms-ext sourcetype="ecp-ord-owls-prod-*" logType="transaction" stage="end" earliest=-1h latest=now | stats count AS current by request] | eval difference=abs(previous-current)/previous*100&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Mar 2021 23:07:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545235#M154411</guid>
      <dc:creator>exocore123</dc:creator>
      <dc:date>2021-03-24T23:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two different values from two different periods</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545262#M154417</link>
      <description>&lt;P&gt;Why don't you just set your initial search to capture the two periods of data like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=oms sourcetype="oms-dashboard" logType="transaction" stage="end" earliest=-1450m latest=-1440m) OR
(index=oms sourcetype="oms-dashboard" logType="transaction" stage="end" earliest=-10m latest=now)
| eval period=if(_time&amp;gt;=relative_time(now(),"-23h"),"current","previous")
| chart count(request) over request by period
| eval difference=abs(previous-current)/previous*100
| table request difference previous current&lt;/LI-CODE&gt;&lt;P&gt;The rest of your search is fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 06:16:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545262#M154417</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-03-25T06:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two different values from two different periods</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545265#M154418</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/43018"&gt;@exocore123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using appendcols will not be as fast as using a single search and also you have to be totally sure that the requests from the previous time period all exist in the current time period otherwise your appendcols will generate the counts out of sync, so the rows won't match.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=oms sourcetype="oms-prod" logType="transaction" stage="end" earliest=-2h latest=-1h) OR
(index=ecp-ord-oms-ext sourcetype="ecp-ord-owls-prod-*" logType="transaction" stage="end" earliest=-1h latest=now)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Use this as your single search and then do your previous logic.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 06:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545265#M154418</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-03-25T06:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two different values from two different periods</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545286#M154422</link>
      <description>&lt;P&gt;Good point - I dont know why I didnt think of that - I'll try this&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 07:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-two-different-values-from-two-different-periods/m-p/545286#M154422</guid>
      <dc:creator>exocore123</dc:creator>
      <dc:date>2021-03-25T07:33:01Z</dc:date>
    </item>
  </channel>
</rss>

