<?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: Snap to previous Friday in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284701#M190685</link>
    <description>&lt;P&gt;Additionally.. if I run it today for Wednesday, I wouldn't want it to consider today and only return partial results.. I was looking for it to return last Wednesday.. &lt;/P&gt;

&lt;P&gt;I know in SQL this is tricky, but was hoping Splunk had something that would get me like 90% there. &lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2016 16:25:52 GMT</pubDate>
    <dc:creator>jclemons7</dc:creator>
    <dc:date>2016-04-06T16:25:52Z</dc:date>
    <item>
      <title>Snap to previous Friday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284698#M190682</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have the following time modifier, which I was hoping would give me the previous Friday as a static date, but it doesn't for obvious reasons.  &lt;/P&gt;

&lt;P&gt;earliest=-7d@w5 latest=-7d@w6 | eval TimeStamp=strftime(strptime(timestamp, "%Y-%m-%dT%H:%M:%S"),"%m/%d/%Y %H") | dedup TimeStamp | table TimeStamp&lt;/P&gt;

&lt;P&gt;What I'm trying to do is craft a query that will always pull the previous Friday (or whatever full weekday I chose).  &lt;/P&gt;

&lt;P&gt;Any help is greatly appreciated.  &lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:09:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284698#M190682</guid>
      <dc:creator>jclemons7</dc:creator>
      <dc:date>2016-04-06T16:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Snap to previous Friday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284699#M190683</link>
      <description>&lt;P&gt;Try  &lt;CODE&gt;w5-7d@d&lt;/CODE&gt; and &lt;CODE&gt;w6-7d@d&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284699#M190683</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-04-06T16:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Snap to previous Friday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284700#M190684</link>
      <description>&lt;P&gt;Thanks so much for your response, &lt;/P&gt;

&lt;P&gt;I think this is similar to the problem I had before.. so, in my query I wanted previous Sunday let's say.. so using your syntax I wrote this: &lt;/P&gt;

&lt;P&gt;earliest=@w0-7d latest=@w1-7d | eval TimeStamp=strftime(strptime(timestamp, "%Y-%m-%dT%H:%M:%S"),"%m/%d/%Y %H") | dedup TimeStamp | table TimeStamp&lt;/P&gt;

&lt;P&gt;But that returns 3/27 for my date and what I'm really looking for would be 4/3 if run today (4/6) if that makes any sense.. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284700#M190684</guid>
      <dc:creator>jclemons7</dc:creator>
      <dc:date>2016-04-06T16:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Snap to previous Friday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284701#M190685</link>
      <description>&lt;P&gt;Additionally.. if I run it today for Wednesday, I wouldn't want it to consider today and only return partial results.. I was looking for it to return last Wednesday.. &lt;/P&gt;

&lt;P&gt;I know in SQL this is tricky, but was hoping Splunk had something that would get me like 90% there. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:25:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284701#M190685</guid>
      <dc:creator>jclemons7</dc:creator>
      <dc:date>2016-04-06T16:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Snap to previous Friday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284702#M190686</link>
      <description>&lt;P&gt;OK, so do &lt;CODE&gt;@w0@d&lt;/CODE&gt; and &lt;CODE&gt;@w1@d&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 16:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284702#M190686</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-04-06T16:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Snap to previous Friday</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284703#M190687</link>
      <description>&lt;P&gt;If you're just looking to get the date, from today, for a specific weekday, you can try this run anywhere sample query. Just update the weekday filter in the where clause.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-7 | table starttime | where strftime(starttime,"%a")="Fri" | eval timestamp=strftime(starttime,"%m/%d/%Y %H")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 17:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Snap-to-previous-Friday/m-p/284703#M190687</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-06T17:31:11Z</dc:date>
    </item>
  </channel>
</rss>

