<?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 results from two timeframes and show differences? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630887#M14732</link>
    <description>&lt;P&gt;So, Asset count * Exposure types = 68?&lt;/P&gt;&lt;P&gt;Not sure how you get 2584 rows from that stats command.&lt;/P&gt;&lt;P&gt;Anyway, so in your example, does the server1 row indicate that today has 1 CVE and 30 days ago there were none? How do you want to reflect 'difference'.&lt;/P&gt;&lt;P&gt;You can try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| stats count values(cveID) as cveID by _time AssetName Exposure
| nomv cveID
| stats list(_time) as time list(*) as * by AssetName Exposure
| eval time=strftime(time, "%F %T")
| where mvcount(cveID)=1 OR mvindex(cveID, 0)!=mvindex(cveID,1)
| table AssetName cveID Exposure count
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2023 23:43:29 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-02-14T23:43:29Z</dc:date>
    <item>
      <title>Compare results from two timeframes and show differences?</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630875#M14729</link>
      <description>&lt;P&gt;Hello Splunk experts - I am trying to create a query that shows the difference in results from two distinct time frames.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Original search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=summary_nexpose
| table AssetName, cveID, Exposure
| mvcombine delim=",", cveID 
| nomv cveID 
| eval numberCVEs=mvcount(split(cveID,",")) 
| rename numberCVEs AS "Number of CVEs"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need to do is add two timeframes: results from 30 days ago vs. results from today, and then show the difference in events between those two timeframes.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630875#M14729</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2023-02-14T22:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare results from two timeframes and show differences?</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630879#M14730</link>
      <description>&lt;P&gt;Use 2 data set ranges. I am not sure what the idea is behind mvcombine and then splitting and counting, but does this start to work for you?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=summary_nexpose (earliest=@d latest=now) OR  
                      (earliest=-30d@d latest=-29d@d)
| bin _time span=1d
| stats count(cveID) as "Number of CVEs" values(cveID) by _time AssetName, Exposure&lt;/LI-CODE&gt;&lt;P&gt;Not sure what you want to do with your comparison. logic&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you want to see from a comparison - a table form or chart or...?&lt;/P&gt;&lt;P&gt;Do you want the two dates combined to both values on the same row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:35:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630879#M14730</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-14T22:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Compare results from two timeframes and show differences?</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630880#M14731</link>
      <description>&lt;P&gt;So that query gives me all the results from both days (2,584 rows). What I want to find out is how the results are different from both days. With my data set there should be 136 rows.&lt;BR /&gt;&lt;BR /&gt;The desired outcome is a table that looks like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;AssetName&lt;/TD&gt;&lt;TD width="25%"&gt;cveID&lt;/TD&gt;&lt;TD width="25%"&gt;Exposure&lt;/TD&gt;&lt;TD width="25%"&gt;Number of CVEs&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;server1&lt;/TD&gt;&lt;TD width="25%"&gt;cve1&lt;/TD&gt;&lt;TD width="25%"&gt;Internal&lt;/TD&gt;&lt;TD width="25%"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;server 2&lt;/TD&gt;&lt;TD width="25%"&gt;cve1, cve2, cve3&lt;/TD&gt;&lt;TD width="25%"&gt;Internal&lt;/TD&gt;&lt;TD width="25%"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630880#M14731</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2023-02-14T22:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare results from two timeframes and show differences?</title>
      <link>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630887#M14732</link>
      <description>&lt;P&gt;So, Asset count * Exposure types = 68?&lt;/P&gt;&lt;P&gt;Not sure how you get 2584 rows from that stats command.&lt;/P&gt;&lt;P&gt;Anyway, so in your example, does the server1 row indicate that today has 1 CVE and 30 days ago there were none? How do you want to reflect 'difference'.&lt;/P&gt;&lt;P&gt;You can try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| stats count values(cveID) as cveID by _time AssetName Exposure
| nomv cveID
| stats list(_time) as time list(*) as * by AssetName Exposure
| eval time=strftime(time, "%F %T")
| where mvcount(cveID)=1 OR mvindex(cveID, 0)!=mvindex(cveID,1)
| table AssetName cveID Exposure count
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 23:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Compare-results-from-two-timeframes-and-show-differences/m-p/630887#M14732</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-14T23:43:29Z</dc:date>
    </item>
  </channel>
</rss>

