<?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: Search that combines last 7 days and year-to-date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-that-combines-last-7-days-and-year-to-date/m-p/543130#M153854</link>
    <description>&lt;P&gt;Previous business week you can get with "snap to" on the relative_time command, so this will calculate the start and end range of week starting on Monday and ending Sunday&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval start_week=relative_time(now(), "-w@w1"), end_week=start_week+(86400 * 7)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note that your use of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| where _time&amp;gt;strptime("2021/02/01 00:00:00","%Y/%m/%d %H:%M:%S")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;seems unnecessary, as you can either set that date range from your search time window or just as &lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest="02/01/2021 00:00:00"&lt;/LI-CODE&gt;&lt;P&gt;on the search line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 04:10:24 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-03-10T04:10:24Z</dc:date>
    <item>
      <title>Search that combines last 7 days and year-to-date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-that-combines-last-7-days-and-year-to-date/m-p/543120#M153851</link>
      <description>&lt;P&gt;My current search below pulls findings for current day and year-to-date starting 2/1/2021.&amp;nbsp; I need help with a way to pull for the previous business week and year-to-date starting 2/1/2021.&amp;nbsp; What adjustments can i make to the search below that will pull that?&lt;/P&gt;&lt;P&gt;index=overwatch-summary overwatch-vuln-type="*"&lt;BR /&gt;| where _time&amp;gt;strptime("2021/02/01 00:00:00","%Y/%m/%d %H:%M:%S")&lt;BR /&gt;| eval _time=if(_time &amp;lt; now()-86400, now()-86400, now())&lt;BR /&gt;| rex field=resource_id "subscriptions/(?&amp;lt;subscriptionId&amp;gt;[0-9a-fA-F\-]+)"&lt;BR /&gt;| lookup subscription_managed.csv subscriptionId OUTPUT managed&lt;BR /&gt;| fillnull value="Unmanaged" managed&lt;BR /&gt;| search managed=Unmanaged&lt;BR /&gt;| fillnull value="" blob_name&lt;BR /&gt;| eval unique_id=if(isnotnull(unique_id),unique_id,sha256('overwatch-vuln-type' . "_" . resource_id . "_" . issue . blob_name))| chart dc(unique_id) as count over _time| bin _time span=1d&lt;BR /&gt;| append&lt;BR /&gt;[ stats c&lt;BR /&gt;| eval _time=now()&lt;BR /&gt;| eval count=0&lt;BR /&gt;| bin _time span=1d&lt;BR /&gt;| fields _time count ]&lt;BR /&gt;| stats sum(count) as count by _time&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 22:58:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-that-combines-last-7-days-and-year-to-date/m-p/543120#M153851</guid>
      <dc:creator>jhackle13</dc:creator>
      <dc:date>2021-03-09T22:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search that combines last 7 days and year-to-date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-that-combines-last-7-days-and-year-to-date/m-p/543130#M153854</link>
      <description>&lt;P&gt;Previous business week you can get with "snap to" on the relative_time command, so this will calculate the start and end range of week starting on Monday and ending Sunday&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval start_week=relative_time(now(), "-w@w1"), end_week=start_week+(86400 * 7)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note that your use of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| where _time&amp;gt;strptime("2021/02/01 00:00:00","%Y/%m/%d %H:%M:%S")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;seems unnecessary, as you can either set that date range from your search time window or just as &lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest="02/01/2021 00:00:00"&lt;/LI-CODE&gt;&lt;P&gt;on the search line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 04:10:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-that-combines-last-7-days-and-year-to-date/m-p/543130#M153854</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-03-10T04:10:24Z</dc:date>
    </item>
  </channel>
</rss>

