<?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: splunk search query to get data last two months every friday with in time range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582403#M202850</link>
    <description>&lt;P&gt;You could generate a set of earliest and latest values to use with your search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
    [| makeresults
    | addinfo
    | eval firstfriday=relative_time(info_min_time,"@w+5d+8h")
    | eval firstfriday=if(firstfriday&amp;lt;info_min_time,firstfriday+(60*60*24*7),firstfriday)
    | eval lastfriday=relative_time(info_max_time,"@w+5d+8h+15m")
    | eval lastfriday=if(lastfriday&amp;gt;info_max_time,lastfriday-(60*60*24*7),lastfriday)
    | eval weeks=floor((lastfriday-firstfriday)/(60*60*24*7))+1
    | eval week=mvrange(0,weeks)
    | mvexpand week
    | eval earliest=firstfriday+(week*60*60*24*7)
    | eval latest=lastfriday-((weeks-week-1)*60*60*24*7)
    | fields - _time
    | fields earliest latest
    | format]&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 25 Jan 2022 14:49:58 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-01-25T14:49:58Z</dc:date>
    <item>
      <title>splunk search query to get data last two months every friday with in time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582397#M202848</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Splunk search query to get data last two months data.&lt;BR /&gt;need only every Friday data in the time range for 15 mins (i.e 08 AM to 08:15 AM every friday) .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;example:&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fieldA&lt;BR /&gt;21/01/2022&amp;nbsp; &amp;nbsp; &amp;nbsp; value1&lt;BR /&gt;14/01/2022&amp;nbsp; &amp;nbsp; &amp;nbsp; value2&lt;BR /&gt;07/01/2022&amp;nbsp; &amp;nbsp; &amp;nbsp;value3&lt;/P&gt;&lt;P&gt;Can anyone pls suggest how can I achieve this?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 14:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582397#M202848</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-01-25T14:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search query to get data last two months every friday with in time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582400#M202849</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54377"&gt;@kirrusk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you explored the timewrap command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Timewrap" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Timewrap&lt;/A&gt;)?&lt;/P&gt;&lt;P&gt;please, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index date_hour=8 date_minute&amp;lt;16 date_wday=friday earliest=-2mon 
| timechart count span=1d
| timewrap 1mon&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 14:31:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582400#M202849</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-25T14:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search query to get data last two months every friday with in time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582403#M202850</link>
      <description>&lt;P&gt;You could generate a set of earliest and latest values to use with your search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
    [| makeresults
    | addinfo
    | eval firstfriday=relative_time(info_min_time,"@w+5d+8h")
    | eval firstfriday=if(firstfriday&amp;lt;info_min_time,firstfriday+(60*60*24*7),firstfriday)
    | eval lastfriday=relative_time(info_max_time,"@w+5d+8h+15m")
    | eval lastfriday=if(lastfriday&amp;gt;info_max_time,lastfriday-(60*60*24*7),lastfriday)
    | eval weeks=floor((lastfriday-firstfriday)/(60*60*24*7))+1
    | eval week=mvrange(0,weeks)
    | mvexpand week
    | eval earliest=firstfriday+(week*60*60*24*7)
    | eval latest=lastfriday-((weeks-week-1)*60*60*24*7)
    | fields - _time
    | fields earliest latest
    | format]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 25 Jan 2022 14:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582403#M202850</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-25T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search query to get data last two months every friday with in time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582467#M202871</link>
      <description>&lt;P&gt;Thanks didn't know about timewrap. Looks useful.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 03:06:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582467#M202871</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-26T03:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search query to get data last two months every friday with in time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582511#M202885</link>
      <description>&lt;P&gt;Can you please help to have some sample search, how to use these "earliest " and "latest" in search&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 10:24:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582511#M202885</guid>
      <dc:creator>kirrusk</dc:creator>
      <dc:date>2022-01-26T10:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search query to get data last two months every friday with in time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582514#M202887</link>
      <description>&lt;P&gt;I am not sure what you are asking for here - I posted an example which uses _internal as the index - simply replace this with your index.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 10:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-query-to-get-data-last-two-months-every-friday/m-p/582514#M202887</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-01-26T10:30:50Z</dc:date>
    </item>
  </channel>
</rss>

