<?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 build query that Only shows new data compared to yesterday in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/600774#M209115</link>
    <description>&lt;P&gt;Hi all, I am trying to build a query that only shows the NEW results compared to yesterday.&lt;/P&gt;
&lt;P&gt;I would like to get some alert and data to show ONLY if the message/key is new today, compared to the results yesterday.&lt;/P&gt;
&lt;P&gt;for example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{query}
| stats count by key&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yesterday, the query returned - "key1", and "key2".&lt;/P&gt;
&lt;P&gt;| key&amp;nbsp; &amp;nbsp; | count |&lt;/P&gt;
&lt;P&gt;| key1 | 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/P&gt;
&lt;P&gt;| key2 | 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/P&gt;
&lt;P&gt;Today, there are some results returned - "key1", and "key3". I would like to get the count of "key3" only as it is new today and didn't show up yesterday.&lt;/P&gt;
&lt;P&gt;| key&amp;nbsp; &amp;nbsp; | count |&lt;/P&gt;
&lt;P&gt;| key3 | 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 22:48:52 GMT</pubDate>
    <dc:creator>winter0827</dc:creator>
    <dc:date>2022-06-13T22:48:52Z</dc:date>
    <item>
      <title>How to build query that Only shows new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/600774#M209115</link>
      <description>&lt;P&gt;Hi all, I am trying to build a query that only shows the NEW results compared to yesterday.&lt;/P&gt;
&lt;P&gt;I would like to get some alert and data to show ONLY if the message/key is new today, compared to the results yesterday.&lt;/P&gt;
&lt;P&gt;for example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{query}
| stats count by key&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yesterday, the query returned - "key1", and "key2".&lt;/P&gt;
&lt;P&gt;| key&amp;nbsp; &amp;nbsp; | count |&lt;/P&gt;
&lt;P&gt;| key1 | 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/P&gt;
&lt;P&gt;| key2 | 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/P&gt;
&lt;P&gt;Today, there are some results returned - "key1", and "key3". I would like to get the count of "key3" only as it is new today and didn't show up yesterday.&lt;/P&gt;
&lt;P&gt;| key&amp;nbsp; &amp;nbsp; | count |&lt;/P&gt;
&lt;P&gt;| key3 | 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 22:48:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/600774#M209115</guid>
      <dc:creator>winter0827</dc:creator>
      <dc:date>2022-06-13T22:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Only show new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/600781#M209120</link>
      <description>&lt;LI-CODE lang="markup"&gt;{query}
| stats count values(date) as date by key
| where mvcount(date) = 1 AND date = today&lt;/LI-CODE&gt;&lt;P&gt;Obviously, you will need to adjust for your real data and field names&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 05:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/600781#M209120</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-07T05:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Only show new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601622#M209379</link>
      <description>&lt;P&gt;Thanks, that solves my problem.&lt;/P&gt;&lt;P&gt;A follow up: how can I compare the values in last 2 weeks and only show the new ones in this week?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 22:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601622#M209379</guid>
      <dc:creator>winter0827</dc:creator>
      <dc:date>2022-06-13T22:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Only show new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601644#M209386</link>
      <description>&lt;P&gt;Please clarify what you are trying to do - is it just a matter of setting the timeframe and using a span of 1 week instead of 1 day?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 05:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601644#M209386</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-14T05:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Only show new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601675#M209402</link>
      <description>&lt;P&gt;firstly, I would like to compare day to day data. And list the count by key.&lt;/P&gt;&lt;P&gt;and then I want to expand the timeframe and compare the week by week, month by month data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for both cases above, I want to know which values are NEW in last day/week/month.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 08:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601675#M209402</guid>
      <dc:creator>winter0827</dc:creator>
      <dc:date>2022-06-14T08:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Only show new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601676#M209403</link>
      <description>&lt;P&gt;Bucket the time by the appropriate span and compare against the current bucket. Something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{query}
| bin _time as date span=1w
| eval today=relative_time(now(),"@w")
| stats count values(date) as date by key
| where mvcount(date) = 1 AND date = today&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;{query}
| bin _time as date span=1mon
| eval today=relative_time(now(),"@mon")
| stats count values(date) as date by key
| where mvcount(date) = 1 AND date = today&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 08:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601676#M209403</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-14T08:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to build query that Only shows new data compared to yesterday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601678#M209404</link>
      <description>&lt;P&gt;Assuming there is no "date" field in your log, first line, day field recognizes your day(today or yesterday or 2 days ago ...) , then second line specifies distinct days and count by each key and finally query shows unique keys related to today(day=1)&lt;BR /&gt;&lt;SPAN&gt;|&amp;nbsp;eval&amp;nbsp;day=round((now()-time)/86400,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| stats&amp;nbsp;count,dc(day)&amp;nbsp;as&amp;nbsp;day_count by&amp;nbsp;key&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;|&amp;nbsp;where day_count =1&amp;nbsp;AND&amp;nbsp;day=1 AND count=1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 08:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-build-query-that-Only-shows-new-data-compared-to/m-p/601678#M209404</guid>
      <dc:creator>marysan</dc:creator>
      <dc:date>2022-06-14T08:26:02Z</dc:date>
    </item>
  </channel>
</rss>

