<?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 create a search results that only takes the monthly data for every other Wednesday? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609914#M50007</link>
    <description>&lt;LI-CODE lang="markup"&gt;index=blah [| makeresults 
    | eval week=mvrange(0,4)
    | mvexpand week
    | eval earliest=relative_time(relative_time(now(),"-1mon@mon+6d"),"+".week."w@w")
    | eval latest=relative_time(earliest,"+".(3+(week%2))."d")
    | fields earliest latest]&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 18 Aug 2022 06:04:27 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-08-18T06:04:27Z</dc:date>
    <item>
      <title>How to create a search results that only takes the monthly data for every other Wednesday?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609873#M50004</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I am making a search that searches data from Sunday-Tuesday one week and Sunday-Wednesday the next week.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a field called "date_wday" which contains data values representing the day of the week (sunday, monday, tuesday, .....,saturday).&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;My search&lt;/EM&gt;: index=blah date_wday=monday OR tuesday OR sunday&lt;BR /&gt;&lt;BR /&gt;My &lt;STRONG&gt;search&lt;/STRONG&gt; successfully &lt;STRONG&gt;filters the data to&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;pull from Sunday-Tuesday&lt;/STRONG&gt; but &lt;STRONG&gt;how can I also have it&lt;/STRONG&gt; &lt;STRONG&gt;add data from every other Wednesday&lt;/STRONG&gt;?&lt;BR /&gt;&lt;BR /&gt;ex. Week 1: Sunday-Tuesday&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Week 2: Sunday-Wednesday&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Week 3: Sunday-Tuesday&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;......&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 21:31:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609873#M50004</guid>
      <dc:creator>ichesla1111</dc:creator>
      <dc:date>2022-08-17T21:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search results that only takes the monthly data for every other Wednesday?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609892#M50005</link>
      <description>&lt;P&gt;You'll probably have to pull in data for Sun-Wed and then discard the data you don't want. You will have to do a calculation about which week it is, so you won't be able to add simple search criteria.&lt;/P&gt;&lt;P&gt;However, if you search back 2 weeks, it is presumably week 1 Sun-Tue and week 2 is Sun-Wed, but it you search back 3 weeks, does it mean the oldest week is Sun-Tue, 2nd oldest Sun-Wed and most recent Sun-Tue?&lt;/P&gt;&lt;P&gt;If so, you can calculate the age in weeks of each event and then add a where clause to filter out the Wednesday on even weeks, e.g. this example works on the _internal index and will treat the current week as including a wednesday, the previous not. If you search an even number of weeks, it will always give tuesdays on the oldest week and then alternate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal date_wday="sunday" OR date_wday="monday" OR date_wday="tuesday" OR date_wday="wednesday" earliest=-2w@w latest=now
| eval age_in_weeks=floor((now() - _time) / (86400 * 7))
| where age_in_weeks % 2 == 0 OR date_wday!="wednesday"
| bin _time span=1w
| fields _time age_in_weeks date_wday
| stats min(age_in_weeks) as min_age max(age_in_weeks) as max_age values(date_wday) as date_wday count by _time&lt;/LI-CODE&gt;&lt;P&gt;if you want to make if based on the search window and always exclude wednesday for the oldest week in the search range, you'll need to know the search range, so use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| addinfo
| eval search_weeks=floor(now() - info_min_time / (86400 * 7)
...&lt;/LI-CODE&gt;&lt;P&gt;to determine the number of search weeks and then tweak the where clause above as needed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 00:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609892#M50005</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-18T00:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search results that only takes the monthly data for every other Wednesday?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609914#M50007</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=blah [| makeresults 
    | eval week=mvrange(0,4)
    | mvexpand week
    | eval earliest=relative_time(relative_time(now(),"-1mon@mon+6d"),"+".week."w@w")
    | eval latest=relative_time(earliest,"+".(3+(week%2))."d")
    | fields earliest latest]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Aug 2022 06:04:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/609914#M50007</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-18T06:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search results that only takes the monthly data for every other Wednesday?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/610156#M50032</link>
      <description>&lt;P&gt;This is awesome, thank you!!! It worked.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 16:47:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-results-that-only-takes-the-monthly-data/m-p/610156#M50032</guid>
      <dc:creator>ichesla1111</dc:creator>
      <dc:date>2022-08-19T16:47:29Z</dc:date>
    </item>
  </channel>
</rss>

